Click here to Skip to main content
15,904,652 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Queries !!! Pin
John R. Shaw1-Mar-06 1:22
John R. Shaw1-Mar-06 1:22 
QuestionMemory Analysis Pin
RadioOpa28-Feb-06 22:56
RadioOpa28-Feb-06 22:56 
AnswerRe: Memory Analysis Pin
John R. Shaw28-Feb-06 23:42
John R. Shaw28-Feb-06 23:42 
GeneralRe: Memory Analysis Pin
RadioOpa28-Feb-06 23:56
RadioOpa28-Feb-06 23:56 
AnswerRe: Memory Analysis Pin
Ryan Binns1-Mar-06 3:07
Ryan Binns1-Mar-06 3:07 
AnswerRe: Memory Analysis Pin
David Crow1-Mar-06 3:15
David Crow1-Mar-06 3:15 
QuestionIP address of the computer using VC++ Pin
mailsafe28-Feb-06 22:51
mailsafe28-Feb-06 22:51 
AnswerRe: IP address of the computer using VC++ Pin
khan++1-Mar-06 0:36
khan++1-Mar-06 0:36 
There are lots of examples here on CP about this topic, but here is some quick code:
WSADATA data;<br />
WSAStartup(MAKEWORD(2,2),&data);<br />
char szHostname[256];<br />
if (gethostname(szHostname, sizeof(szHostname)))<br />
{<br />
WSAGetLastError());<br />
//return<br />
}<br />
//get host information from the host name<br />
HOSTENT* pHostEnt = gethostbyname(szHostname);<br />
if (pHostEnt == NULL)<br />
{<br />
WSAGetLastError());<br />
//return<br />
}<br />
//check the length of the IP adress<br />
if (pHostEnt->h_length != 4)<br />
{<br />
//return<br />
}<br />
//call the virtual callback function in a loop<br />
int nAdapter = 0;<br />
in_addr address;<br />
CopyMemory(&address.S_un.S_addr, pHostEnt->h_addr_list[nAdapter], pHostEnt->h_length);<br />
dwIP = MAKEIPADDRESS(address.S_un.S_un_b.s_b4, address.S_un.S_un_b.s_b3, address.S_un.S_un_b.s_b2, address.S_un.S_un_b.s_b1);


Now the address is in dwIP as a DWORD also.
Also available through the:
address.S_un.S_un_b.s_b1<br />
address.S_un.S_un_b.s_b2<br />
address.S_un.S_un_b.s_b3<br />
address.S_un.S_un_b.s_b4

as individual unsigned bytes.


this is this.
AnswerRe: IP address of the computer using VC++ Pin
vivek.s.vivek1-Mar-06 0:43
vivek.s.vivek1-Mar-06 0:43 
AnswerRe: IP address of the computer using VC++ Pin
ThatsAlok1-Mar-06 2:45
ThatsAlok1-Mar-06 2:45 
Questionto link MDI interface to a dialog Pin
mailsafe28-Feb-06 22:41
mailsafe28-Feb-06 22:41 
QuestionRe: to link MDI interface to a dialog Pin
Nibu babu thomas1-Mar-06 16:49
Nibu babu thomas1-Mar-06 16:49 
QuestionUsing Sockets in Win32 DLL Pin
castratroi28-Feb-06 21:03
castratroi28-Feb-06 21:03 
Questionvirtual function declarations Pin
lastgen28-Feb-06 20:45
lastgen28-Feb-06 20:45 
AnswerRe: virtual function declarations Pin
lastgen28-Feb-06 20:55
lastgen28-Feb-06 20:55 
GeneralRe: virtual function declarations Pin
Cedric Moonen28-Feb-06 20:58
Cedric Moonen28-Feb-06 20:58 
AnswerRe: virtual function declarations Pin
Cedric Moonen28-Feb-06 20:57
Cedric Moonen28-Feb-06 20:57 
AnswerRe: virtual function declarations Pin
Nibu babu thomas28-Feb-06 20:57
Nibu babu thomas28-Feb-06 20:57 
AnswerRe: virtual function declarations Pin
John R. Shaw28-Feb-06 23:03
John R. Shaw28-Feb-06 23:03 
QuestionC++ Pin
yaaqub28-Feb-06 20:04
yaaqub28-Feb-06 20:04 
AnswerRe: C++ Pin
Nibu babu thomas28-Feb-06 20:10
Nibu babu thomas28-Feb-06 20:10 
AnswerRe: C++ Pin
Ryan Binns28-Feb-06 20:11
Ryan Binns28-Feb-06 20:11 
AnswerRe: C++ Pin
_AnsHUMAN_ 28-Feb-06 21:25
_AnsHUMAN_ 28-Feb-06 21:25 
GeneralRe: C++ Pin
David Crow1-Mar-06 3:18
David Crow1-Mar-06 3:18 
GeneralRe: C++ Pin
_AnsHUMAN_ 1-Mar-06 5:03
_AnsHUMAN_ 1-Mar-06 5:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.