Click here to Skip to main content
15,928,109 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralWindows Hooks Pin
Nnamdi Onyeyiri7-Jan-03 8:07
Nnamdi Onyeyiri7-Jan-03 8:07 
GeneralRe: Windows Hooks Pin
Nish Nishant7-Jan-03 10:05
sitebuilderNish Nishant7-Jan-03 10:05 
GeneralRe: Windows Hooks Pin
Nnamdi Onyeyiri7-Jan-03 10:34
Nnamdi Onyeyiri7-Jan-03 10:34 
GeneralRe: Windows Hooks Pin
Nish Nishant7-Jan-03 11:31
sitebuilderNish Nishant7-Jan-03 11:31 
GeneralCRichEdit crashes Pin
Ricky_TheBard7-Jan-03 8:06
Ricky_TheBard7-Jan-03 8:06 
GeneralDetecting when an internet connection is active Pin
fferland7-Jan-03 7:52
fferland7-Jan-03 7:52 
GeneralRe: Detecting when an internet connection is active Pin
valikac7-Jan-03 9:20
valikac7-Jan-03 9:20 
GeneralRe: Detecting when an internet connection is active Pin
Todd Smith7-Jan-03 9:58
Todd Smith7-Jan-03 9:58 
bool IsConnectedToInternet(void)
{
	DEBUGF("IsConnectedToInternet");

	WORD wVersionRequested = MAKEWORD(1, 1);
	WSADATA	wsaData;
	TCHAR hostaname[1000];
	int	hostname_size = sizeof(hostaname);
	bool connected = false;

	if (WSAStartup(wVersionRequested, &wsaData) != 0)
	{
		DEBUGF("WSAStartup Failed (%i.%i) %s",
			wsaData.wHighVersion, wsaData.wVersion, wsaData.szDescription);
		return connected;
	}

	if (gethostname(hostaname, hostname_size) != SOCKET_ERROR)
	{
		struct hostent FAR *h = gethostbyname(hostaname);
		if (h != NULL)
		{
			// cif ip=127.0.0.1 then we are not connected
			DEBUGF("gethostname %s %s", h->h_name, h->h_addr_list[0]);
			if (strncmp(h->h_addr_list[0], "\x7f\x0\x0\0x1", 4)!=0)
			{
				connected = true;
			}
		}
	}
	else
	{
		DEBUGF("gethostname Failed");
	}

	WSACleanup();

	return connected;
}


Todd Smith
GeneralCStatic scroll bar Pin
Dean Goodman7-Jan-03 7:37
Dean Goodman7-Jan-03 7:37 
GeneralRe: CStatic scroll bar Pin
PJ Arends7-Jan-03 11:48
professionalPJ Arends7-Jan-03 11:48 
GeneralListView InsertMark does not display Pin
Hiusing7-Jan-03 6:59
Hiusing7-Jan-03 6:59 
GeneralContext Help on a button in MFC CFormView Pin
DionChen7-Jan-03 5:55
DionChen7-Jan-03 5:55 
GeneralRe: Context Help on a button in MFC CFormView Pin
PJ Arends7-Jan-03 11:54
professionalPJ Arends7-Jan-03 11:54 
GeneralCListCtrl::GetItemData() Problem Pin
lpvoid7-Jan-03 5:39
lpvoid7-Jan-03 5:39 
Generaldisplay a jpg Pin
Didaa7-Jan-03 3:35
Didaa7-Jan-03 3:35 
GeneralRe: display a jpg Pin
Gary Kirkham7-Jan-03 5:01
Gary Kirkham7-Jan-03 5:01 
GeneralRe: display a jpg Pin
Davide Pizzolato7-Jan-03 11:05
Davide Pizzolato7-Jan-03 11:05 
GeneralRe: display a jpg Pin
Jason Henderson7-Jan-03 11:29
Jason Henderson7-Jan-03 11:29 
GeneralMy paranoia Pin
georgiek507-Jan-03 2:47
georgiek507-Jan-03 2:47 
GeneralRe: My paranoia Pin
Maximilien7-Jan-03 3:17
Maximilien7-Jan-03 3:17 
GeneralRe: My paranoia Pin
Alvaro Mendez7-Jan-03 5:19
Alvaro Mendez7-Jan-03 5:19 
GeneralRe: My paranoia Pin
georgiek507-Jan-03 6:26
georgiek507-Jan-03 6:26 
GeneralPropertySheet Pin
mzakarni7-Jan-03 0:42
mzakarni7-Jan-03 0:42 
GeneralRe: PropertySheet Pin
Abbas_Riazi7-Jan-03 0:49
professionalAbbas_Riazi7-Jan-03 0:49 
GeneralRe: PropertySheet Pin
mzakarni7-Jan-03 2:05
mzakarni7-Jan-03 2:05 

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.