Click here to Skip to main content
15,896,557 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionintercepting program display? Pin
Gibb3h19-Apr-10 22:35
Gibb3h19-Apr-10 22:35 
AnswerRe: intercepting program display? Pin
Michel Godfroid20-Apr-10 1:30
Michel Godfroid20-Apr-10 1:30 
GeneralRe: intercepting program display? Pin
Gibb3h20-Apr-10 1:36
Gibb3h20-Apr-10 1:36 
QuestionBrightness controller / OCX for notebook backlight Pin
AmericanoInPhils19-Apr-10 22:17
AmericanoInPhils19-Apr-10 22:17 
QuestionDVD burning problem using windows XP Service pack2 Pin
raj157619-Apr-10 21:33
raj157619-Apr-10 21:33 
AnswerRe: DVD burning problem using windows XP Service pack2 Pin
Michel Godfroid19-Apr-10 22:38
Michel Godfroid19-Apr-10 22:38 
GeneralRe: DVD burning problem using windows XP Service pack2 Pin
raj157619-Apr-10 23:17
raj157619-Apr-10 23:17 
GeneralRe: DVD burning problem using windows XP Service pack2 Pin
Michel Godfroid19-Apr-10 23:46
Michel Godfroid19-Apr-10 23:46 
GeneralRe: DVD burning problem using windows XP Service pack2 Pin
raj157620-Apr-10 0:41
raj157620-Apr-10 0:41 
GeneralRe: DVD burning problem using windows XP Service pack2 Pin
Michel Godfroid20-Apr-10 1:02
Michel Godfroid20-Apr-10 1:02 
AnswerRe: DVD burning problem using windows XP Service pack2 Pin
Moak20-Apr-10 0:53
Moak20-Apr-10 0:53 
QuestionListview header mouse click Pin
arun_pk19-Apr-10 20:08
arun_pk19-Apr-10 20:08 
AnswerRe: Listview header mouse click Pin
Stephen Hewitt19-Apr-10 20:58
Stephen Hewitt19-Apr-10 20:58 
AnswerRe: Listview header mouse click Pin
KarstenK19-Apr-10 21:00
mveKarstenK19-Apr-10 21:00 
QuestionMonitoring received packets on app which uses IOCP(hooking) Pin
l0odi19-Apr-10 18:51
l0odi19-Apr-10 18:51 
AnswerRe: Monitoring received packets on app which uses IOCP(hooking) Pin
l0odi21-Apr-10 6:10
l0odi21-Apr-10 6:10 
Questionhow to embed the window of my program in the desktop?(The window is showed under the desktop icons.) Pin
letianzhu19-Apr-10 17:50
letianzhu19-Apr-10 17:50 
AnswerRe: how to embed the window of my program in the desktop?(The window is showed under the desktop icons.) Pin
Code-o-mat19-Apr-10 21:42
Code-o-mat19-Apr-10 21:42 
GeneralRe: how to embed the window of my program in the desktop?(The window is showed under the desktop icons.) Pin
Stephen Hewitt19-Apr-10 21:57
Stephen Hewitt19-Apr-10 21:57 
AnswerRe: how to embed the window of my program in the desktop?(The window is showed under the desktop icons.) Pin
Michel Godfroid20-Apr-10 3:20
Michel Godfroid20-Apr-10 3:20 
GeneralRe: how to embed the window of my program in the desktop?(The window is showed under the desktop icons.) Pin
letianzhu20-Apr-10 4:55
letianzhu20-Apr-10 4:55 
QuestionWinSock 2 + UNICODE / Win32 Pin
Fareed Rizkalla19-Apr-10 11:22
Fareed Rizkalla19-Apr-10 11:22 
WSADATA WS2Info;
if (!WSAStartup(MAKEWORD(2,2), &WS2Info))
{
	MessageBox(g_hWindow, L"WinSock2 Initialized", L"Tracing", NULL);

	SOCKET IPv4 = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
	if (IPv4 != INVALID_SOCKET)
	{
		MessageBox(g_hWindow, L"Resolving Host", L"Tracing", NULL);

		hostent *ResolveHost;
		char *HostName = (char *)malloc(MB_CUR_MAX);
		wctomb_s( NULL, HostName, MB_CUR_MAX, (wchar_t)Download->HostName);
		//char *HostName = "www.microsoft.com";
		ResolveHost = gethostbyname(HostName);

		if (ResolveHost->h_addr_list[0])
		{
			MessageBox(g_hWindow, L"Adding Resolved Host to SOCKADDR", L"Tracing", NULL);

			SOCKADDR_IN HostService;
			HostService.sin_family = AF_INET;
			HostService.sin_addr.s_addr = (ULONG)ResolveHost->h_addr_list;
			HostService.sin_port = htons(80);

				MessageBox(g_hWindow, L"Connecting", L"Tracing", NULL);
			if (connect(IPv4, (SOCKADDR*) &HostService, sizeof(HostService)) != SOCKET_ERROR)
			{
				MessageBox(g_hWindow, L"Connected", L"Tracing", NULL);
			}
			else
				MessageBox(g_hWindow, L"Connection Failed", L"Tracing", NULL);
		}
	}
	else
		MessageBox(g_hWindow, L"Socket Creation Failed!", L"Tracing", NULL);

	closesocket(IPv4);
}
WSACleanup();


I spent sometime using Network Monitor only to find that HostName resolving isn't returning an accurate IP to the UNICODE use.

char *HostName = (char *)malloc(MB_CUR_MAX);
wctomb_s( NULL, HostName, MB_CUR_MAX, (wchar_t)Download->HostName);


If anyone has any pointers to solving the problem it will be appreciated.
AnswerRe: WinSock 2 + UNICODE / Win32 Pin
Richard MacCutchan19-Apr-10 11:46
mveRichard MacCutchan19-Apr-10 11:46 
GeneralRe: WinSock 2 + UNICODE / Win32 Pin
Stephen Hewitt19-Apr-10 14:41
Stephen Hewitt19-Apr-10 14:41 
GeneralRe: WinSock 2 + UNICODE / Win32 Pin
Fareed Rizkalla19-Apr-10 15:45
Fareed Rizkalla19-Apr-10 15:45 

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.