Click here to Skip to main content
15,895,667 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionPrevent an property page to close Pin
_Flaviu17-Nov-11 0:54
_Flaviu17-Nov-11 0:54 
AnswerRe: Prevent an property page to close Pin
Chuck O'Toole17-Nov-11 2:57
Chuck O'Toole17-Nov-11 2:57 
QuestionRe: Prevent an property page to close Pin
David Crow17-Nov-11 8:44
David Crow17-Nov-11 8:44 
AnswerRe: Prevent an property page to close Pin
_Flaviu17-Nov-11 21:11
_Flaviu17-Nov-11 21:11 
Questionvideo(Playing using directx) refreshing Problem Pin
VCProgrammer16-Nov-11 21:21
VCProgrammer16-Nov-11 21:21 
AnswerRe: video(Playing using directx) refreshing Problem Pin
Code-o-mat17-Nov-11 4:23
Code-o-mat17-Nov-11 4:23 
QuestionOverlapped IO sockets sending and receiving at the same time Pin
jtlancer16-Nov-11 9:36
jtlancer16-Nov-11 9:36 
AnswerRe: Overlapped IO sockets sending and receiving at the same time Pin
Richard Andrew x6416-Nov-11 10:19
professionalRichard Andrew x6416-Nov-11 10:19 
I would do it by using separate event handles for the read and the write, and then inspecting the return value from your wait function to see which event handle was signaled.

EDIT ==========

OK, I see what you're doing. You're polling GetQueuedCompletionStatus, right? Well that's not the optimum model to use with completion ports, as you see.

You're much better off using the OVERLAPPED structure when you call WSARecv and WSASend, and then seeing which event handle is signaled.

Here's the pseudo code:

C++
ORecv = new OVERLAPPED struct;
Set ORecv's event handle to your Recv event;
call WSARecv with ORecv;

OSend = new OVERLAPPED struct;
Set OSend's event handle to your Send event;
call WSASend with OSend;

Wait on the two handles;

See which handle was signalled, 
and then call GetQueuedCompletionStatus;




The difficult we do right away...
...the impossible takes slightly longer.


modified 16-Nov-11 16:45pm.

GeneralRe: Overlapped IO sockets sending and receiving at the same time Pin
jtlancer16-Nov-11 11:51
jtlancer16-Nov-11 11:51 
GeneralRe: Overlapped IO sockets sending and receiving at the same time Pin
Mark Salsbery16-Nov-11 12:14
Mark Salsbery16-Nov-11 12:14 
GeneralRe: Overlapped IO sockets sending and receiving at the same time Pin
Richard Andrew x6416-Nov-11 12:50
professionalRichard Andrew x6416-Nov-11 12:50 
QuestionCSimpleDate and Visual Studio 2010 Pin
xyloweb16-Nov-11 4:39
xyloweb16-Nov-11 4:39 
AnswerRe: CSimpleDate and Visual Studio 2010 Pin
Chris Losinger16-Nov-11 4:54
professionalChris Losinger16-Nov-11 4:54 
SuggestionRe: CSimpleDate and Visual Studio 2010 Pin
David Crow16-Nov-11 5:03
David Crow16-Nov-11 5:03 
AnswerRe: CSimpleDate and Visual Studio 2010 Pin
Maximilien16-Nov-11 8:59
Maximilien16-Nov-11 8:59 
AnswerRe: CSimpleDate and Visual Studio 2010 Pin
xyloweb25-Nov-11 9:09
xyloweb25-Nov-11 9:09 
SuggestionCollaborated Tool/Library development Pin
BrainlessLabs.com15-Nov-11 22:59
BrainlessLabs.com15-Nov-11 22:59 
GeneralRe: Collaborated Tool/Library development Pin
Richard MacCutchan15-Nov-11 23:51
mveRichard MacCutchan15-Nov-11 23:51 
GeneralRe: Collaborated Tool/Library development Pin
BrainlessLabs.com16-Nov-11 6:53
BrainlessLabs.com16-Nov-11 6:53 
QuestionEnumerating Registry Subkeys c++ Pin
Member 824522215-Nov-11 20:06
Member 824522215-Nov-11 20:06 
AnswerRe: Enumerating Registry Subkeys c++ Pin
Richard MacCutchan15-Nov-11 22:09
mveRichard MacCutchan15-Nov-11 22:09 
AnswerRe: Enumerating Registry Subkeys c++ Pin
User 742933815-Nov-11 22:14
professionalUser 742933815-Nov-11 22:14 
GeneralRe: Enumerating Registry Subkeys c++ Pin
Richard MacCutchan15-Nov-11 23:55
mveRichard MacCutchan15-Nov-11 23:55 
Questionsimple static library linking to dll issue. Pin
Android Lava15-Nov-11 16:32
Android Lava15-Nov-11 16:32 
AnswerRe: simple static library linking to dll issue. Pin
Richard MacCutchan15-Nov-11 22:04
mveRichard MacCutchan15-Nov-11 22:04 

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.