Accessing and Configuring Local Network Card

Accessing and Configuring Local Network Card

Post by TUxS » Fri, 24 Feb 2006 02:52:29


Hi All,

I am trying to write an Visual C++ MFC app which will read the current
network
settings such as IP Address, Subnet Mask etc and if necessary make
changes to the IP Address etc.

Can anyone offer any advise as to the best method to access this
information and if possible a method to amend it?

Thanks for the help.

Kind regards

Martin :)
 
 
 

Accessing and Configuring Local Network Card

Post by AliR » Fri, 24 Feb 2006 05:26:38

The IP address info is in the registry

http://www.yqcomputer.com/

Another ones you might want to look into the Net....() functions in the SDK.

AliR.

 
 
 

Accessing and Configuring Local Network Card

Post by Pete Delga » Fri, 24 Feb 2006 05:34:25


I don't believe that the referenced code will help you in a DHCP
environment...

-Pete
 
 
 

Accessing and Configuring Local Network Card

Post by TUxS » Fri, 24 Feb 2006 06:03:53

it will be a static ip environment that the program will be used in

hope that helps :)

thanks Martin
 
 
 

Accessing and Configuring Local Network Card

Post by AliR » Fri, 24 Feb 2006 06:25:51

Yeah that helped, it's in the registery

http://www.yqcomputer.com/

AliR.






the
 
 
 

Accessing and Configuring Local Network Card

Post by Michael K. » Fri, 24 Feb 2006 07:21:40

Don't modify the registry. Use the IP helper functions (inside iphlpapi)
instead:
http://www.yqcomputer.com/

For example, GetAdaptersInfo (
http://www.yqcomputer.com/ )
gets information about all adapters installed on the computer, including IP
address subnet mask etc. There's sample code at the cited link (although
the call to GlobalFree() must be replaced by free() to get it to work)




SDK.
 
 
 

Accessing and Configuring Local Network Card

Post by TUxS » Wed, 01 Mar 2006 03:49:27

Hi Michael,

thanks for the IP helper functions, i have been able to gather the
information i require, all i need to do now is set the details on the network
card :)

thanks for your help

Martin :)