Click here to Skip to main content
15,891,951 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhow to get ip address from host name? Pin
josip cagalj14-Jan-08 22:20
josip cagalj14-Jan-08 22:20 
AnswerRe: how to get ip address from host name? Pin
CPallini14-Jan-08 23:13
mveCPallini14-Jan-08 23:13 
GeneralRe: how to get ip address from host name? Pin
Nitheesh George14-Jan-08 23:48
Nitheesh George14-Jan-08 23:48 
GeneralThanks but... Pin
CPallini14-Jan-08 23:51
mveCPallini14-Jan-08 23:51 
GeneralRe: Thanks but... Pin
Hamid_RT15-Jan-08 4:24
Hamid_RT15-Jan-08 4:24 
GeneralRe: how to get ip address from host name? Pin
josip cagalj15-Jan-08 0:18
josip cagalj15-Jan-08 0:18 
GeneralRe: how to get ip address from host name? Pin
David Crow15-Jan-08 2:49
David Crow15-Jan-08 2:49 
AnswerRe: how to get ip address from host name? Pin
Nitheesh George14-Jan-08 23:51
Nitheesh George14-Jan-08 23: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 20:44
vicky0000014-Jan-08 20:44 
GeneralRe: Hyperlink text inside balloon tooltip for a taskbar icon Pin
Member 75496016-Jan-08 9:05
Member 75496016-Jan-08 9:05 
Generalto disable incremental linking Pin
zon_cpp14-Jan-08 20:40
zon_cpp14-Jan-08 20:40 
GeneralRe: to disable incremental linking Pin
Cedric Moonen14-Jan-08 21:31
Cedric Moonen14-Jan-08 21:31 
GeneralRe: to disable incremental linking Pin
zon_cpp15-Jan-08 1:18
zon_cpp15-Jan-08 1:18 
GeneralRe: to disable incremental linking Pin
David Crow15-Jan-08 2:53
David Crow15-Jan-08 2:53 
GeneralRe: to disable incremental linking Pin
zon_cpp15-Jan-08 1:19
zon_cpp15-Jan-08 1:19 
GeneralRe: to disable incremental linking Pin
Mark Salsbery15-Jan-08 6:39
Mark Salsbery15-Jan-08 6:39 
Generalabout dwAllocationGranularity of SYSTEM_INFO Pin
George_George14-Jan-08 20:19
George_George14-Jan-08 20:19 
GeneralRe: about dwAllocationGranularity of SYSTEM_INFO Pin
Matthew Faithfull14-Jan-08 21:42
Matthew Faithfull14-Jan-08 21:42 
GeneralRe: about dwAllocationGranularity of SYSTEM_INFO Pin
George_George14-Jan-08 23:09
George_George14-Jan-08 23:09 
Questionhow can draw wave form in audio files? [modified] Pin
Le@rner14-Jan-08 20:00
Le@rner14-Jan-08 20:00 
AnswerRe: how can draw wave form in audio files? Pin
Cedric Moonen14-Jan-08 21:05
Cedric Moonen14-Jan-08 21:05 
GeneralRe: how can draw wave form in audio files? Pin
Le@rner14-Jan-08 21:14
Le@rner14-Jan-08 21:14 
GeneralRe: how can draw wave form in audio files? Pin
Cedric Moonen14-Jan-08 21:22
Cedric Moonen14-Jan-08 21:22 
GeneralRe: how can draw wave form in audio files? Pin
Le@rner14-Jan-08 22:25
Le@rner14-Jan-08 22:25 
GeneralRe: how can draw wave form in audio files? Pin
Iain Clarke, Warrior Programmer15-Jan-08 5:01
Iain Clarke, Warrior Programmer15-Jan-08 5: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.