Article View: borland.public.cppbuilder.nativeapi
Article #13167Re: Retrieving Address info from GetAdaptersInfo
From: Maurice Anderson
Date: Thu, 23 Oct 2003 07:49
Date: Thu, 23 Oct 2003 07:49
43 lines
2383 bytes
2383 bytes
Hello Remy:
> Did you allocate pinfo before passing it to GetAdaptersInfo()?"
Yes I did as : pinfo = NULL;
I tried the ARRAYOFCONST macro and the compiler errors went away, however, I
don't get any data when I do a:
ShowMessage(m_macaddress);
thannx
"Remy Lebeau (TeamB)" <gambit47.no.spam@no.spam.yahoo.com> wrote in message
news:3f977d1e@newsgroups.borland.com...
>
> "Maurice Anderson" <mauriceanderson@hotmail.com> wrote in message
> news:3f977b4f@newsgroups.borland.com...
> > Please help. Any input would be greatly appreciated.
>
> > GetAdaptersInfo(pinfo,&len);
>
> Did you allocate pinfo before passing it to GetAdaptersInfo()? If not,
then
> you are using an uninitialized pointer, and your code will crash at
runtime.
>
> > Using the above code, I get a compiler error that says:
> > Type mismatch in parameter 'args'(wanted 'const TVarRec*,
> > got 'unsigned char')
>
> Format() expects an array of TVarRec, but you are not passing such an
array
> at all. Have a look at the ARRAYOFCONST maco, ie:
>
> m_macaddress.Format("%02X:%02X:%02X:%02X:%02X:%02X",
> ARRAYOFCONST(( (int)pinfo->Address[0], (int)pinfo->Address[1],
> (int)pinfo->Address[2], (int)pinfo->Address[3],
> (int)pinfo->Address[4], (int)pinfo->Address[5] )) );
>
>
> Gambit
>
>
Technical Details
Message-ID:
<3f978730$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.media.kyoto-u.ac.jp!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3f977b4f@newsgroups.borland.com> <3f977d1e@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,90790ba1c056df66 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-10-23 01:09:19 PST From: "Maurice Anderson" <mauriceanderson@hotmail.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3f977b4f@newsgroups.borland.com> <3f977d1e@newsgroups.borland.com> Subject: Re: Retrieving Address info from GetAdaptersInfo Date: Thu, 23 Oct 2003 00:49:18 -0700 Lines: 45 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 64.30.203.223 Message-ID: <3f978730$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1066895152 64.30.203.223 (23 Oct 2003 00:45:52 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.media.kyoto-u.ac.jp!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