🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: How to get NIC MAC address under Windows 2000/XP

#14967
From: Vladimir Afanasyev
Date: Thu, 24 Jul 2003 07:14
40 lines
2196 bytes
Hi,
Use the force (WMI) Yu-lin.
It is native for Win2000/XP.
I disconnect cable and it still work.
See my WMI samples:
http://codecentral.borland.com/codecentral/ccweb.exe/listing?id=19443

If you will use BCB6 do not forget to disable speed 
optimization in the Project Options. It is problem of BCB6.
NetAdapterConf - sample name.

Vladimir.


"Yu-lin Chang" <ylchang@ascc.net> wrote:
>Hi,
>
>When using BCB, I know it can use NETBEUI API to get 
>the MAC address(es) of network card(s) in Windows 2000/XP.
>
>But if the network cable be disconnected or the network
>cable did not connect to a hub (or other device), Windows
>will disable the NETBEUI API. Then I cannot get the MAC
>address until the cable be reconnected properly.
>
>Another problem is if user does not config the "BETBIOS"
>or the "File and Print Share" protocol, the NETBEUI API
>will not availible.
>
>Is there any Windows API (or BCB's propritory function)
>that can determinate the MAC address even the NETBEUI
>API is not availible?
>
>
>Thanks in advance,
>
>
>Yu-lin Chang
>--
Technical Details
Message-ID: <3f1f874d$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!216.166.71.118.MISMATCH!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3f1f57a9$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,34a00c071ed95cd8
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-07-24 00:17:49 PST
From: "Vladimir Afanasyev" <avv@systema.kiev.ua>
Sender: "Vladimir Afanasyev" <avv@systema.kiev.ua>
Reply-To: "Vladimir Afanasyev" <avv@systema.kiev.ua>
Subject: Re: How to get NIC MAC address under Windows 2000/XP
Newsgroups: borland.public.cppbuilder.nativeapi
X-User-Info: 212.82.216.226 212.82.216.226    
X-Forwarded-For: 192.168.0.147
References:  <3f1f57a9$1@newsgroups.borland.com>
NNTP-Posting-Host: 207.105.83.65
Message-ID: <3f1f874d$1@newsgroups.borland.com>
Date: 24 Jul 2003 00:14:21 -0700
X-Trace: newsgroups.borland.com 1059030861 207.105.83.65 (24 Jul 2003 00:14:21 -0700)
Lines: 41
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!216.166.71.118.MISMATCH!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail