🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #4596

Re: all IP adresses of the local system

#4596
From: EB
Date: Thu, 22 Dec 2005 17:03
69 lines
3123 bytes
Thanks for the quick reply.

This is what I put in the try{}:
 try {
  // put code here.
  // Make an initial call to GetAdaptersInfo to get
  // the necessary size into the ulOutBufLen variable
  if (GetAdaptersInfo((PIP_ADAPTER_INFO)pAdapterInfo->get(), &ulOutBufLen) 
== ERROR_BUFFER_OVERFLOW) { +++ This is Line 324 +++
   pAdapterInfo->reset( new char[ ulOutBufLen ] );
  }

  if (GetAdaptersInfo( (PIP_ADAPTER_INFO)pAdapterInfo->get(), 
&ulOutBufLen)== NO_ERROR) {
   PIP_ADAPTER_INFO pAdapter = (PIP_ADAPTER_INFO)pAdapterInfo->get(); 
+++ This is Line 329 +++
   while (pAdapter){
    PIP_ADDR_STRING pIpAddress = &(pAdapter->IpAddressList);
    while (pIpAddress) {
     AnsiString AdapterAddress = pIpAddress->IpAddress.String;
     LimitMemo1->Lines->Add("Address="+AdapterAddress);
     pIpAddress = pIpAddress->Next;
    }
    pAdapter = pAdapter->Next;
   }
  }
 }
+++++++++++
And these are the compile errors:
  [C++ Error] ClientMain.cpp(324): E2288 Pointer to structure required on 
left side of -> or ->*
  [C++ Error] ClientMain.cpp(325): E2288 Pointer to structure required on 
left side of -> or ->*
  [C++ Error] ClientMain.cpp(328): E2288 Pointer to structure required on 
left side of -> or ->*
  [C++ Error] ClientMain.cpp(329): E2288 Pointer to structure required on 
left side of -> or ->*
  [C++ Error] ClientMain.cpp(400): E2096 Illegal structure operation
+++++++++++
"Jonathan Benedicto" <incorrect@no.server> wrote in message 
news:43aad54d@newsgroups.borland.com...
> EB wrote:
>> The following doesn't work:
>> char *pAdapterInfo( new char[ulOutBufLen] );
>
> // untested.
>
> char *pAdapterInfo = new char[ulOutBufLen];
> try
> {
>    // put code here.
> }
> catch( Exception const &E )
> {
>    delete[] pAdapterInfo;
>    throw;
> }
> catch( ... )
> {
>    delete[] pAdapterInfo;
>    throw;
> }
> delete[] pAdapterInfo;
>
> Jonathan
>
> http://jomitech.com/mtbcc32.shtml - Multi-threaded compilation for BCB
> http://jomitech.com/forum - JomiTech Forums
> 
Technical Details
Message-ID: <43aadc17$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <43a832cb$1@newsgroups.borland.com> <43aad18b@newsgroups.borland.com> <43aad54d@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,744a3315ee7b00aa
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "EB" <elias.berelian@snet.net>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <43a832cb$1@newsgroups.borland.com> <43aad18b@newsgroups.borland.com> <43aad54d@newsgroups.borland.com>
Subject: Re: all IP adresses of the local system
Date: Thu, 22 Dec 2005 12:03:24 -0500
Lines: 71
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 144.160.5.25
Message-ID: <43aadc17$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1135270935 144.160.5.25 (22 Dec 2005 09:02:15 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail