Article View: borland.public.cppbuilder.nativeapi
Article #13265Re: Retrieving Address info from GetAdaptersInfo
From: Remy Lebeau (TeamB)
Date: Thu, 23 Oct 2003 07:05
Date: Thu, 23 Oct 2003 07:05
24 lines
1863 bytes
1863 bytes
"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:
<3f977d1e@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3f977b4f@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,90790ba1c056df66,start X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-10-23 00:09:18 PST From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3f977b4f@newsgroups.borland.com> Subject: Re: Retrieving Address info from GetAdaptersInfo Date: Thu, 23 Oct 2003 00:05:03 -0700 Lines: 26 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 67.22.137.75 Message-ID: <3f977d1e@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1066892574 67.22.137.75 (23 Oct 2003 00:02:54 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail