char HostName[256];
char IP[16];
gethostname(HostName, sizeof(HostName));
HOSTENT * HostData = gethostbyname(HostName);
sockaddr_in addr;
memset(&addr,0,sizeof(addr));
memcpy(&(LocalAddress.sin_addr.s_addr), HostData->h_addr,4);
strcpy(IP, inet_ntoa(LocalAddress.sin_addr));
MultiByteToWideChar(CP_ACP, NULL, IP, -1, LocalIP, RemoteCommIPLen);
--------------------You are not a real programmer until you end all your sentences with semicolons; (c) 2000 ROAD Programming
You are unique. Just like everybody else.
"Mechanical engineers design weapons; civil engineers design targets."
"Sensitivity is adjustable, so you can set it to detect elephants and other small creatures." -- Product Description for a vibration sensor