Click here to Skip to main content
15,911,531 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Parallel Data Calculation ( reduce calculation time) Pin
Maximilien1-Mar-06 2:31
Maximilien1-Mar-06 2:31 
AnswerRe: Parallel Data Calculation ( reduce calculation time) Pin
David Crow1-Mar-06 3:12
David Crow1-Mar-06 3:12 
Questionram acces Pin
ss200628-Feb-06 23:26
ss200628-Feb-06 23:26 
AnswerRe: ram acces Pin
John R. Shaw28-Feb-06 23:47
John R. Shaw28-Feb-06 23:47 
AnswerRe: ram acces Pin
toxcct28-Feb-06 23:47
toxcct28-Feb-06 23:47 
AnswerRe: ram acces Pin
khan++1-Mar-06 0:27
khan++1-Mar-06 0:27 
QuestionAnti-Debugger Pin
zon_cpp28-Feb-06 23:19
zon_cpp28-Feb-06 23:19 
AnswerRe: Anti-Debugger Pin
John R. Shaw28-Feb-06 23:45
John R. Shaw28-Feb-06 23:45 
AnswerRe: Anti-Debugger Pin
khan++1-Mar-06 0:15
khan++1-Mar-06 0:15 
Questionbitmap images Pin
ramyasangeet28-Feb-06 23:15
ramyasangeet28-Feb-06 23:15 
AnswerRe: bitmap images Pin
Vinaya1-Mar-06 0:01
Vinaya1-Mar-06 0:01 
AnswerRe: bitmap images Pin
Nibu babu thomas1-Mar-06 0:02
Nibu babu thomas1-Mar-06 0:02 
Questionmotherboard id vedio card id Pin
ss200628-Feb-06 23:07
ss200628-Feb-06 23:07 
AnswerRe: motherboard id vedio card id Pin
ThatsAlok1-Mar-06 2:42
ThatsAlok1-Mar-06 2:42 
QuestionQueries !!! Pin
Subramaniam s.V.28-Feb-06 23:06
Subramaniam s.V.28-Feb-06 23:06 
AnswerRe: Queries !!! Pin
toxcct28-Feb-06 23:19
toxcct28-Feb-06 23:19 
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 

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.