AddIPAddress

Hi all,

i'm trying to set the ip address from within an app, this is the code i am using however nothing is happening i've had a look around and i think it should work.

could someone please take a look and tell me what is wrong with it

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

PMIB_IPADDRTABLE pIPAddrTable;

UINT iaIPAddress;

UINT imIPMask;

ULONG NTEContext = 0;

ULONG NTEInstance = 0;

iaIPAddress = inet_addr("192.168.0.123");

imIPMask = inet_addr("255.255.255.0");

int dwRetVal3 = AddIPAddress(iaIPAddress, imIPMask, pIPAddrTable->table[0].dwIndex, &NTEContext, &NTEInstance);

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

thanks for your help

Martin :)



Answer this question

AddIPAddress

  • AddIPAddress