Click here to Skip to main content
15,921,694 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Adding const won't compile Pin
toxcct6-Jun-06 22:00
toxcct6-Jun-06 22:00 
AnswerRe: Adding const won't compile Pin
Michael Dunn7-Jun-06 2:52
sitebuilderMichael Dunn7-Jun-06 2:52 
QuestionHow to clear the screen to recover to the old style Pin
xuwenq886-Jun-06 18:45
xuwenq886-Jun-06 18:45 
AnswerRe: How to clear the screen to recover to the old style Pin
Hamid_RT6-Jun-06 19:11
Hamid_RT6-Jun-06 19:11 
AnswerRe: How to clear the screen to recover to the old style [modified] Pin
Naveen6-Jun-06 21:50
Naveen6-Jun-06 21:50 
Generalbest book for VC++ beginners Pin
sach!!6-Jun-06 18:32
sach!!6-Jun-06 18:32 
GeneralRe: best book for VC++ beginners Pin
nicknotyet7-Jun-06 10:15
nicknotyet7-Jun-06 10:15 
GeneralRe: best book for VC++ beginners Pin
bob169727-Jun-06 17:46
bob169727-Jun-06 17:46 
GeneralRe: best book for VC++ beginners Pin
nicknotyet8-Jun-06 3:29
nicknotyet8-Jun-06 3:29 
GeneralRe: best book for VC++ beginners Pin
Nemanja Trifunovic7-Jun-06 15:18
Nemanja Trifunovic7-Jun-06 15:18 
GeneralRe: best book for VC++ beginners Pin
bob169727-Jun-06 17:46
bob169727-Jun-06 17:46 
GeneralRe: best book for VC++ beginners Pin
Krishnatv7-Jun-06 19:33
Krishnatv7-Jun-06 19:33 
GeneralRe: best book for VC++ beginners Pin
ThatsAlok7-Jun-06 19:43
ThatsAlok7-Jun-06 19:43 
QuestionXP/win2000 Scroller Click event Pin
anilksingh6-Jun-06 18:00
anilksingh6-Jun-06 18:00 
QuestionOpen Forms in a second Monitor Pin
spy_charly6-Jun-06 17:43
spy_charly6-Jun-06 17:43 
Question__LINE__ doesn't work in Visual Studio 2005 Pin
User 2155976-Jun-06 16:43
User 2155976-Jun-06 16:43 
AnswerRe: __LINE__ doesn't work in Visual Studio 2005 Pin
User 2155976-Jun-06 17:01
User 2155976-Jun-06 17:01 
QuestionDifferent CSplitterWnd behaviour needed Pin
Vladimir Svrkota6-Jun-06 14:00
professionalVladimir Svrkota6-Jun-06 14:00 
AnswerRe: Different CSplitterWnd behaviour needed Pin
LeeeNN6-Jun-06 14:37
LeeeNN6-Jun-06 14:37 
GeneralRe: Different CSplitterWnd behaviour needed Pin
Vladimir Svrkota7-Jun-06 16:06
professionalVladimir Svrkota7-Jun-06 16:06 
QuestionOverlapped sockets and completion routines. Pin
luke7276-Jun-06 13:43
luke7276-Jun-06 13:43 
I'm trying to send and receive data using overlapped sockets and completion routines. Everything works fine, except that quite often the final WSARecv doesn't complete until after some kind of (VERY LONG) timeout. This is basically what my completion routine functions look like:

void CALLBACK OnReceiveComplete(...)
{
	if(cbTransferred == 0)
	{
		// Doesn't get here until after a long timeout.
		printf("Done.\r\n");
	}
	else
	{
		printf("Received %d bytes.\r\n", cbTransferred);
		WSARecv(..., &OnReceiveComplete);
	}
}

void CALLBACK OnSendComplete(...)
{
	printf("Sent %d bytes.\r\n", cbTransferred);
	WSARecv(..., &OnReceiveComplete);
}


Obviously there is error checking and other things, but that is the gist of it.

Interestingly it doesn't happen on all attempts. I'm doing a simple HTTP GET, and it ALWAYS "hangs" on "www.google.com", but it NEVER does on "www.cnn.com". Does this have something to do with how the servers are setup, or is there something I can do about this? Right now I just forcefully close the socket if I don't get any response for a certain amount of time. I've seen lots of examples for IOCP and overlapped events, but NONE for overlapped completion routines. I haven't been able to figure out this problem for the longest time, so this is my last-ditch attempt to get an answer.

On a side note, if I use the WinInet functions asynchronously the problem goes away (but there are other issues with using WinInet so I want to avoid it). So obviously there must be some way to know when there is no more data to read. I just can't figure it out.
QuestionDrawing a bitmap Pin
Pugman8126-Jun-06 12:12
Pugman8126-Jun-06 12:12 
AnswerRe: Drawing a bitmap Pin
Chris Losinger6-Jun-06 15:46
professionalChris Losinger6-Jun-06 15:46 
GeneralRe: Drawing a bitmap Pin
Pugman8126-Jun-06 23:07
Pugman8126-Jun-06 23:07 
GeneralRe: Drawing a bitmap [modified] Pin
Chris Losinger7-Jun-06 1:13
professionalChris Losinger7-Jun-06 1:13 

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.