Click here to Skip to main content
15,911,890 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: .PCH size slowing compilation? Pin
toxcct14-Nov-07 6:28
toxcct14-Nov-07 6:28 
QuestionAsynchronous overlapped I/O Pin
racette14-Nov-07 5:07
racette14-Nov-07 5:07 
AnswerRe: Asynchronous overlapped I/O Pin
led mike14-Nov-07 5:21
led mike14-Nov-07 5:21 
GeneralRe: Asynchronous overlapped I/O Pin
racette14-Nov-07 5:39
racette14-Nov-07 5:39 
GeneralRe: Asynchronous overlapped I/O Pin
led mike14-Nov-07 6:30
led mike14-Nov-07 6:30 
GeneralRe: Asynchronous overlapped I/O Pin
racette14-Nov-07 8:54
racette14-Nov-07 8:54 
GeneralRe: Asynchronous overlapped I/O [modified] Pin
led mike14-Nov-07 10:49
led mike14-Nov-07 10:49 
GeneralRe: Asynchronous overlapped I/O Pin
racette14-Nov-07 11:13
racette14-Nov-07 11:13 
led mike wrote:
Ok let's work off the examples and you point out what you don't understand


ok.

First, I created my named pipes with the FILE_FLAG_OVERLAPPED and PIPE_WAIT parameters. Then, for each call to ReadFile and WriteFile, I specify a distinct OVERLAPPED structure in which I specified a distinct event.

After each call to WriteFile and ReadFile, I verify the return value. If its TRUE, then the data has been sent/received correctly. If it's FALSE, then I verify the value of GetLastError(). If GetLastError() returns ERROR_IO_PENDING, Im not sure what to do. (note that if it's any other kind of error I just close the app)

I want to make sure all the data has been sent/received.

I read that I can either call GetOverlappedResult() or wait for the event I specified to the overlapped structure with a call to WaitForSingleObject().

I tried both, but it does not seem to work. It does work locally (both softwares running on the same pc) but it does not work over the network. I seem to get only 4212 bytes out of my 153,268 bytes.

It is so weird!

Also, I have the perfect example of conflicting information on the MSDN website:

On this web page
http://msdn2.microsoft.com/en-us/library/ms686358.aspx

you can read in the fourth paragraph that "To call a function to perform an overlapped operation, the calling thread must specify a pointer to an OVERLAPPED structure that has had all of its members initialized to zero."

Then on this web page
http://msdn2.microsoft.com/en-us/library/ms684342.aspx

look at the description of the 'Pointer' parameter. It says "Reserved for system use; do not use."

Now what should I do? set it to zero? it's a pointer!!!!!!

The same goes for hEvent.

I just can't seem to find accurate information.

Anyway, thanks for your reply.

Benjamin Racette
CAE software developer
racette@cae.com

GeneralRe: Asynchronous overlapped I/O Pin
led mike14-Nov-07 11:45
led mike14-Nov-07 11:45 
GeneralRe: Asynchronous overlapped I/O Pin
racette14-Nov-07 11:54
racette14-Nov-07 11:54 
GeneralRe: Asynchronous overlapped I/O Pin
led mike15-Nov-07 4:29
led mike15-Nov-07 4:29 
GeneralRe: Asynchronous overlapped I/O Pin
racette16-Nov-07 7:29
racette16-Nov-07 7:29 
GeneralRe: Asynchronous overlapped I/O Pin
led mike16-Nov-07 20:43
led mike16-Nov-07 20:43 
GeneralRe: Asynchronous overlapped I/O Pin
racette19-Nov-07 7:23
racette19-Nov-07 7:23 
GeneralRe: Asynchronous overlapped I/O Pin
led mike19-Nov-07 7:49
led mike19-Nov-07 7:49 
GeneralRe: Asynchronous overlapped I/O Pin
racette19-Nov-07 8:33
racette19-Nov-07 8:33 
GeneralRe: Asynchronous overlapped I/O Pin
racette19-Nov-07 8:49
racette19-Nov-07 8:49 
GeneralRe: Asynchronous overlapped I/O Pin
racette23-Nov-07 4:16
racette23-Nov-07 4:16 
GeneralRe: Asynchronous overlapped I/O Pin
led mike26-Nov-07 4:56
led mike26-Nov-07 4:56 
GeneralRe: Asynchronous overlapped I/O Pin
racette26-Nov-07 7:07
racette26-Nov-07 7:07 
GeneralRe: Asynchronous overlapped I/O Pin
racette26-Nov-07 7:09
racette26-Nov-07 7:09 
GeneralRe: Asynchronous overlapped I/O Pin
led mike26-Nov-07 8:27
led mike26-Nov-07 8:27 
GeneralRe: Asynchronous overlapped I/O Pin
racette26-Nov-07 10:18
racette26-Nov-07 10:18 
GeneralRe: Asynchronous overlapped I/O Pin
led mike26-Nov-07 10:45
led mike26-Nov-07 10:45 
GeneralRe: Asynchronous overlapped I/O Pin
Mark Salsbery14-Nov-07 12:07
Mark Salsbery14-Nov-07 12:07 

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.