Discussion:
trying to get the local ip using wininet
(too old to reply)
n***@gmail.com
2005-06-17 09:08:15 UTC
Permalink
Hey!

Is there a way to get the local machine IP by using the wininet
library, I am trying to get the IP of the machine on which the client
is running on.

There is a simple call that one can make in java
ipAddress = (InetAddress.getLocalHost()).getHostAddress();

I want to do something similar to this in vc++.

Any help would be appreciated.
Reymarx Gereda
2005-06-18 15:59:35 UTC
Permalink
I'm not aware of a WinInet function to do that.

You can use WinSock's getaddrinfo function (which replaced to gethostbyname)

Here you can find some help about the function:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/getaddrinfo_2.asp

Hope this can help you
--
Reymarx [MSFT]
Windows- Networking
This posting is provided "AS IS" with no warranties, and confers no rights
Post by n***@gmail.com
Hey!
Is there a way to get the local machine IP by using the wininet
library, I am trying to get the IP of the machine on which the client
is running on.
There is a simple call that one can make in java
ipAddress = (InetAddress.getLocalHost()).getHostAddress();
I want to do something similar to this in vc++.
Any help would be appreciated.
Continue reading on narkive:
Loading...