Click here to Skip to main content
15,887,421 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
Question[SOLVED]Problem using dmColor member of DEVMODE struct [modified] Pin
hhh19-Apr-10 7:14
hhh19-Apr-10 7:14 
QuestionUnhandled exception Pin
PankajB19-Apr-10 5:59
PankajB19-Apr-10 5:59 
AnswerRe: Unhandled exception Pin
Richard MacCutchan19-Apr-10 6:14
mveRichard MacCutchan19-Apr-10 6:14 
GeneralRe: Unhandled exception Pin
PankajB19-Apr-10 6:50
PankajB19-Apr-10 6:50 
GeneralRe: Unhandled exception Pin
Richard MacCutchan19-Apr-10 6:57
mveRichard MacCutchan19-Apr-10 6:57 
AnswerRe: Unhandled exception Pin
Stephen Hewitt19-Apr-10 14:09
Stephen Hewitt19-Apr-10 14:09 
GeneralRe: Unhandled exception Pin
ramana.g19-Apr-10 19:30
ramana.g19-Apr-10 19:30 
GeneralRe: Unhandled exception Pin
Stephen Hewitt19-Apr-10 21:48
Stephen Hewitt19-Apr-10 21:48 
GeneralRe: Unhandled exception Pin
Saurabh.Garg19-Apr-10 19:51
Saurabh.Garg19-Apr-10 19:51 
GeneralRe: Unhandled exception Pin
Stephen Hewitt19-Apr-10 21:48
Stephen Hewitt19-Apr-10 21:48 
Questiontransaction - rollback in C ??? Pin
aa_zz19-Apr-10 0:20
aa_zz19-Apr-10 0:20 
AnswerRe: transaction - rollback in C ??? PinPopular
CPallini19-Apr-10 0:39
mveCPallini19-Apr-10 0:39 
AnswerRe: transaction - rollback in C ??? PinPopular
KarstenK19-Apr-10 1:09
mveKarstenK19-Apr-10 1:09 
GeneralRe: transaction - rollback in C ??? Pin
aa_zz19-Apr-10 22:29
aa_zz19-Apr-10 22:29 

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.