Click here to Skip to main content
16,011,428 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralDigital Signal Processing Pin
progman2-Jan-03 11:53
progman2-Jan-03 11:53 
GeneralRe: Digital Signal Processing Pin
Brian Tietz2-Jan-03 12:30
Brian Tietz2-Jan-03 12:30 
GeneralRe: Digital Signal Processing Pin
progman2-Jan-03 14:31
progman2-Jan-03 14:31 
GeneralRe: Digital Signal Processing Pin
Brian Tietz2-Jan-03 15:09
Brian Tietz2-Jan-03 15:09 
GeneralRe: Digital Signal Processing Pin
Tim Smith2-Jan-03 12:55
Tim Smith2-Jan-03 12:55 
GeneralRe: Digital Signal Processing Pin
progman2-Jan-03 14:36
progman2-Jan-03 14:36 
GeneralRe: Digital Signal Processing Pin
Tim Smith2-Jan-03 15:27
Tim Smith2-Jan-03 15:27 
Generalgethostbyaddress AND 11004 Pin
(Steven Hicks)n+12-Jan-03 11:08
(Steven Hicks)n+12-Jan-03 11:08 
How can I get the IP address of a url? I been using gethostbyaddress but it keeps returning WS_NODATA (even on cp, msdn.microsoft.com ...)
BTW (m_locSite=GetLocationURL()):


if (m_locSite.Find("file://",0)==-1)<br />
	{<br />
		//Fix Address<br />
		//Date: 1 2 02<br />
		m_locSite=m_locSite.Mid(0,m_locSite.Find("/",8));<br />
		if (m_locSite.Find("://",0)==-1) m_locSite="http://"+m_locSite;<br />
		//<br />
<br />
		WSADATA wsa;<br />
		WSAStartup( 0x0101, &wsa );<br />
		unsigned long addr = inet_addr(ConvertCStringToChar(m_locSite));<br />
		<br />
		if (addr == INADDR_NONE)<br />
		{<br />
			//Not a dotted address, then do a lookup of the name<br />
				<br />
			HOSTENT * lpHostEnt = gethostbyname(ConvertCStringToChar(m_locSite));<br />
			CString tmpEr;<br />
			tmpEr.Format("%d",WSAGetLastError());<br />
			MessageBox(m_locSite+" | "+tmpEr);<br />
<br />
			if (lpHostEnt)MessageBox(inet_ntoa( *(LPIN_ADDR)*(lpHostEnt->h_addr_list) ));<br />
			<br />
			<br />
			//else MessageBox("Could not resolve the host name: "+GetLocationURL());<br />
		}<br />
		WSACleanup();<br />
	}


-Steven
CP Addict

By reading this message you are held fully responsible for any of the mispelln's or grammer, issues, found on, codeproject.com.

For those who were wondering, actual (Linux) Penguins were harmed in creating this message.

Visit Ltpb.8m.com

404Browser (Efficient, Fast, Secure Web Browser): 404Browser.com


GeneralRe: gethostbyaddress AND 11004 Pin
Brian Tietz2-Jan-03 11:37
Brian Tietz2-Jan-03 11:37 
GeneralRe: gethostbyaddress AND 11004 Pin
(Steven Hicks)n+12-Jan-03 11:57
(Steven Hicks)n+12-Jan-03 11:57 
GeneralRe: gethostbyaddress AND 11004 Pin
(Steven Hicks)n+12-Jan-03 11:57
(Steven Hicks)n+12-Jan-03 11:57 
GeneralOff the top of your head... Pin
Martin Marvinski2-Jan-03 10:15
Martin Marvinski2-Jan-03 10:15 
GeneralRe: Off the top of your head... Pin
Joaquín M López Muñoz2-Jan-03 11:47
Joaquín M López Muñoz2-Jan-03 11:47 
GeneralMouse Position Pin
progman2-Jan-03 9:58
progman2-Jan-03 9:58 
GeneralRe: Mouse Position Pin
Shog92-Jan-03 10:00
sitebuilderShog92-Jan-03 10:00 
GeneralList view control with tab stops Pin
2-Jan-03 9:47
suss2-Jan-03 9:47 
GeneralRe: List view control with tab stops Pin
Shog92-Jan-03 9:59
sitebuilderShog92-Jan-03 9:59 
GeneralRe: List view control with tab stops Pin
2-Jan-03 10:58
suss2-Jan-03 10:58 
GeneralRe: List view control with tab stops Pin
Shog92-Jan-03 11:31
sitebuilderShog92-Jan-03 11:31 
GeneralRe: List view control with tab stops Pin
Brian Tietz2-Jan-03 11:52
Brian Tietz2-Jan-03 11:52 
GeneralRe: List view control with tab stops Pin
Shog92-Jan-03 12:01
sitebuilderShog92-Jan-03 12:01 
GeneralRe: List view control with tab stops Pin
Brian Tietz2-Jan-03 12:23
Brian Tietz2-Jan-03 12:23 
GeneralRe: List view control with tab stops Pin
Shog92-Jan-03 16:02
sitebuilderShog92-Jan-03 16:02 
GeneralTools for internationalization Pin
Anonymous2-Jan-03 9:28
Anonymous2-Jan-03 9:28 
GeneralRe: Tools for internationalization Pin
Chris Richardson2-Jan-03 20:59
Chris Richardson2-Jan-03 20:59 

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.