Wanted to use getaddrinfo function instead gethostbyname (recommended in the MSDN Library)
Cannot compile and link because function not available. ws2tcpip.h is from April 1998. I am using Visual Studio 6 with service pack 5.
Why is the new function not available?
Both gethobyname & gethobyaddr retrurns a short(i.e netbios)
name of local computer, not FQDN.But how to obtain FQDN?
// will return SERVER1
pHost = gethostbyname(szHostName);
// will also return SERVER1 ! , not dlp1-24.loc.isp.com
Other programm like MIRC ,say that
/dns 184.108.40.206(my ip) resolved to SERVER1
/dns 220.127.116.11 resolved to FQDN dlp1-25.loc.isp.com
Can i get FQDN for myself host?And how i'm should do it?
...if you ONLY want the lousy IP and Hostname of the local computer why bother with all that crap!
WORD wVersionRequested; <- what's with programming nerds that they have to make the variables long??
wVersionRequested???? Example: CInternetSession *session that's it!! not CInternetSession *myInternetSession <-waste of time..shorten that shit.
and as for this program why the hell would you want to waste your time writing all that when you can easily just add the winsock control give it a variable (something short)not m_ThisIsMyWinSockControl
and just do this on either a button function , messagebox ..whatever!!
I've been looking for ages in Windows-API documentation and on "msdn"-pages. Without result. After 5 minutes of research here at codeguru I've found Your source code. 10 minutes later I hade inserted the code into my project aand it worked well from the beginning.