mac address

mac address

Postby NageswaraRao, G. » Tue Oct 11, 2005 2:52 am

Can any please help me how to find mac address of the PC ?
Thanks in advance

NageswaraRao
NageswaraRao, G.
India
email: nagesh_g@yahoo.com
NageswaraRao, G.
 
Posts: 3
Joined: Tue Oct 11, 2005 2:10 am
Location: India

Postby Antonio Linares » Tue Oct 11, 2005 7:54 am

You may use GETNETCARDID()
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42111
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

mac address

Postby NageswaraRao, G. » Tue Oct 11, 2005 9:42 pm

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, G.
India
email: nagesh_g@yahoo.com
NageswaraRao, G.
 
Posts: 3
Joined: Tue Oct 11, 2005 2:10 am
Location: India

Postby Antonio Linares » Tue Oct 11, 2005 10:28 pm

NageswaraRao,

Are you using xHarbour commercial ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42111
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

GetNetCardID

Postby srrao » Wed Oct 12, 2005 6:01 am

Add IPHLPAPI.LIB from bcc55 into your script if your are using bcc
srrao
 
Posts: 10
Joined: Sat Oct 08, 2005 4:24 am
Location: The Nilgiris, South India

mac address

Postby NageswaraRao, G. » Wed Oct 12, 2005 6:51 am

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, G.
India
email: nagesh_g@yahoo.com
NageswaraRao, G.
 
Posts: 3
Joined: Tue Oct 11, 2005 2:10 am
Location: India

Postby Antonio Linares » Wed Oct 12, 2005 7:34 am

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.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42111
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

GetNetCardID under xhb Commercial

Postby AlexSchaft » Thu Jun 07, 2007 7:18 am

Hi,

I'm getting a unresolved external __chkstk when I try to use this
User avatar
AlexSchaft
 
Posts: 172
Joined: Fri Oct 07, 2005 1:29 pm
Location: Edenvale, Gauteng, South Africa

Postby Antonio Linares » Thu Jun 07, 2007 7:21 am

Alex,

Try linking Borland cw32.lib
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42111
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby AlexSchaft » Thu Jun 07, 2007 7:25 am

A borland library with commercial xharbour?
User avatar
AlexSchaft
 
Posts: 172
Joined: Fri Oct 07, 2005 1:29 pm
Location: Edenvale, Gauteng, South Africa

Postby Antonio Linares » Thu Jun 07, 2007 7:31 am

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 ) { }
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42111
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

GetNetCardID

Postby AlexSchaft » Thu Jun 07, 2007 7:39 am

If I add that dummy function, GetNetCardID kills my app.

Will ask on xhb newsgroup

Alex
User avatar
AlexSchaft
 
Posts: 172
Joined: Fri Oct 07, 2005 1:29 pm
Location: Edenvale, Gauteng, South Africa

Postby Antonio Linares » Thu Jun 07, 2007 8:19 am

Alex,

> Will ask on xhb newsgroup

Yes, its the right way :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42111
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Thu Jun 07, 2007 8:32 am

Alex,

Just out of curiosity, please try it this way:

BOOL _chkstk( void ) { return TRUE; }
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42111
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby AlexSchaft » Thu Jun 07, 2007 9:06 am

No luck :?

Busy trying to get following code to work. It compiles. I just need to figure out how to return an array of adapter names and addresses

Code: Select all  Expand view  RUN
#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
}
User avatar
AlexSchaft
 
Posts: 172
Joined: Fri Oct 07, 2005 1:29 pm
Location: Edenvale, Gauteng, South Africa

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Silvio.Falconi and 77 guests