Home I/P Address
-
Hi, I don't know if this necessarily a MFC question but ... I am using CAsyncSockets Class I have hard coded the I/P address from my lap top 10.0.0.205 I am wondering if there is a api that would get me this address I tried CASynSocket::GetSockName ut didn't come up with anything thanks
-
Hi, I don't know if this necessarily a MFC question but ... I am using CAsyncSockets Class I have hard coded the I/P address from my lap top 10.0.0.205 I am wondering if there is a api that would get me this address I tried CASynSocket::GetSockName ut didn't come up with anything thanks
-
See https://msdn.microsoft.com/en-us/library/windows/desktop/ms738518(v=vs.85).aspx[^] and associated functions.
-
See https://msdn.microsoft.com/en-us/library/windows/desktop/ms738518(v=vs.85).aspx[^] and associated functions.
LONG ret_code;
PVOID ipaddr = new char[100];
DWORD ipaddr_size = 100;
ret_code = RegGetValue(HKEY_LOCAL_MACHINE,
_T ("SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\{CFCAB3F3-0143-4AE0-A915-873AD57C942A}"),
_T("IPAddress"),
RRF_RT_ANY,
NULL,
ipaddr,
&ipaddr_size);