Can any please help me how to find mac address of the PC ?
Thanks in advance
NageswaraRao
Can any please help me how to find mac address of the PC ?
Thanks in advance
NageswaraRao
You may use GETNETCARDID()
Thanks Mr. Antonio.
But I am getting unlinked external "GetAdapetersInfo" referenced by function "NETCRDID"
I am using xHarbour with FWH.
Can you help me with this please?
Regards
Nageswararao
NageswaraRao,
Are you using xHarbour commercial ?
Add IPHLPAPI.LIB from bcc55 into your script if your are using bcc
I am using xharbour with bcc55. not the commercial version. i included the lib iphlpapi.lib as advised by srrao and now its working fine. thanks mr. antonio and mr. sanjay
NageswaraRao,
Yes, right, that library is needed. We already provided it included in samples\buildh.bat. I guess you are using an older version of buildh.bat.
Hi,
I'm getting a unresolved external __chkstk when I try to use this
Alex,
Try linking Borland cw32.lib
A borland library with commercial xharbour?
ops, my mistake ![]()
Then you should require it to xHB guys.
If I am not wrong, __chkstk stands for check stack, so you could safely create a dummy C function with such name
void _chkstk( void ) { }
If I add that dummy function, GetNetCardID kills my app.
Will ask on xhb newsgroup
Alex
Alex,
> Will ask on xhb newsgroup
Yes, its the right way ![]()
Alex,
Just out of curiosity, please try it this way:
BOOL _chkstk( void ) { return TRUE; }
#include <iphlpapi.h>
// Fetches the MAC address and prints it
static void GetMACaddress(void)
{
IP_ADAPTER_INFO AdapterInfo[16]; // Allocate information
// for up to 16 NICs
DWORD dwBufLen = sizeof(AdapterInfo); // Save memory size of buffer
DWORD dwStatus = GetAdaptersInfo( // Call GetAdapterInfo
AdapterInfo, // [out] buffer to receive data
&dwBufLen); // [in] size of receive data buffer
// assert(dwStatus == ERROR_SUCCESS); // Verify return value is
// valid, no buffer overflow
PIP_ADAPTER_INFO pAdapterInfo = AdapterInfo; // Contains pointer to
// current adapter info
do {
// PrintMACaddress(pAdapterInfo->Address); // Print MAC address
pAdapterInfo = pAdapterInfo->Next; // Progress through
// linked list
}
while(pAdapterInfo); // Terminate if last adapter
}