Click here to Skip to main content
15,844,387 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhow to get ip address from host name? Pin
josip cagalj14-Jan-08 23:20
josip cagalj14-Jan-08 23:20 
AnswerRe: how to get ip address from host name? Pin
CPallini15-Jan-08 0:13
mveCPallini15-Jan-08 0:13 
GeneralRe: how to get ip address from host name? Pin
Nitheesh George15-Jan-08 0:48
Nitheesh George15-Jan-08 0:48 
GeneralThanks but... Pin
CPallini15-Jan-08 0:51
mveCPallini15-Jan-08 0:51 
GeneralRe: Thanks but... Pin
Hamid_RT15-Jan-08 5:24
Hamid_RT15-Jan-08 5:24 
GeneralRe: how to get ip address from host name? Pin
josip cagalj15-Jan-08 1:18
josip cagalj15-Jan-08 1:18 
GeneralRe: how to get ip address from host name? Pin
David Crow15-Jan-08 3:49
David Crow15-Jan-08 3:49 
AnswerRe: how to get ip address from host name? Pin
Nitheesh George15-Jan-08 0:51
Nitheesh George15-Jan-08 0:51 
Hi,
I think the following code will help u.



sockaddr_in pAddrTo = (struct sockaddr_in *)&whereto;
memset(pAddrTo,0,sizeof(sockaddr_in));
pAddrTo->sin_family = AF_INET;
pAddrTo->sin_addr.s_addr = inet_addr(m_szDestinationIp);
pAddrTo->sin_port = 0;

if(pAddrTo->sin_addr.s_addr != (unsigned)-1)
{
strcpy(szHostName, m_szDestinationIp);
}
else
{
hp = gethostbyname(m_szDestinationIp);
if (hp)
{
pAddrTo->sin_family = hp->h_addrtype;
memcpy(&pAddrTo->sin_addr.s_addr,hp->h_addr_list[0], hp->h_length);
strcpy(szHostName, hp->h_name);
}
else
{
sprintf(szPingResult,"unknown host %s\n", m_szDestinationIp);
ClosePing();
return szPingResult;
}
}
GeneralHyperlink text inside balloon tooltip for a taskbar icon Pin
vicky0000014-Jan-08 21:44
vicky0000014-Jan-08 21:44 
GeneralRe: Hyperlink text inside balloon tooltip for a taskbar icon Pin
Member 75496016-Jan-08 10:05
Member 75496016-Jan-08 10:05 
Generalto disable incremental linking Pin
zon_cpp14-Jan-08 21:40
zon_cpp14-Jan-08 21:40 
GeneralRe: to disable incremental linking Pin
Cedric Moonen14-Jan-08 22:31
Cedric Moonen14-Jan-08 22:31 
GeneralRe: to disable incremental linking Pin
zon_cpp15-Jan-08 2:18
zon_cpp15-Jan-08 2:18 
GeneralRe: to disable incremental linking Pin
David Crow15-Jan-08 3:53
David Crow15-Jan-08 3:53 
GeneralRe: to disable incremental linking Pin
zon_cpp15-Jan-08 2:19
zon_cpp15-Jan-08 2:19 
GeneralRe: to disable incremental linking Pin
Mark Salsbery15-Jan-08 7:39
Mark Salsbery15-Jan-08 7:39 
Generalabout dwAllocationGranularity of SYSTEM_INFO Pin
George_George14-Jan-08 21:19
George_George14-Jan-08 21:19 
GeneralRe: about dwAllocationGranularity of SYSTEM_INFO Pin
Matthew Faithfull14-Jan-08 22:42
Matthew Faithfull14-Jan-08 22:42 
GeneralRe: about dwAllocationGranularity of SYSTEM_INFO Pin
George_George15-Jan-08 0:09
George_George15-Jan-08 0:09 
Questionhow can draw wave form in audio files? [modified] Pin
Le@rner14-Jan-08 21:00
Le@rner14-Jan-08 21:00 
AnswerRe: how can draw wave form in audio files? Pin
Cedric Moonen14-Jan-08 22:05
Cedric Moonen14-Jan-08 22:05 
GeneralRe: how can draw wave form in audio files? Pin
Le@rner14-Jan-08 22:14
Le@rner14-Jan-08 22:14 
GeneralRe: how can draw wave form in audio files? Pin
Cedric Moonen14-Jan-08 22:22
Cedric Moonen14-Jan-08 22:22 
GeneralRe: how can draw wave form in audio files? Pin
Le@rner14-Jan-08 23:25
Le@rner14-Jan-08 23:25 
GeneralRe: how can draw wave form in audio files? Pin
Iain Clarke, Warrior Programmer15-Jan-08 6:01
Iain Clarke, Warrior Programmer15-Jan-08 6:01 

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.