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

C / C++ / MFC

 
QuestionHow reduce build time of the project? Pin
ganesh.dp30-Jul-10 3:04
ganesh.dp30-Jul-10 3:04 
AnswerRe: How reduce build time of the project? Pin
Sauro Viti30-Jul-10 3:19
professionalSauro Viti30-Jul-10 3:19 
AnswerRe: How reduce build time of the project? Pin
Maximilien30-Jul-10 4:46
Maximilien30-Jul-10 4:46 
AnswerRe: How reduce build time of the project? Pin
Abhi Lahare30-Jul-10 8:15
Abhi Lahare30-Jul-10 8:15 
AnswerRe: How reduce build time of the project? Pin
Aescleal30-Jul-10 20:49
Aescleal30-Jul-10 20:49 
QuestionWriteFile returning zero and GetLastError returning 997(ERROR_IO_PENDING) Pin
learningvisualc30-Jul-10 2:59
learningvisualc30-Jul-10 2:59 
AnswerRe: WriteFile returning zero and GetLastError returning 997(ERROR_IO_PENDING) Pin
Cool_Dev30-Jul-10 3:37
Cool_Dev30-Jul-10 3:37 
AnswerRe: WriteFile returning zero and GetLastError returning 997(ERROR_IO_PENDING) Pin
Xequen30-Jul-10 4:09
Xequen30-Jul-10 4:09 
If serial_handle was opened with FILE_FLAG_OVERLAPPED and lpOverlapped is not NULL, the write operation starts at the offset specified in the OVERLAPPED structure and WriteFile may return before the write operation has been completed. In this case, WriteFile returns FALSE and the GetLastError function returns ERROR_IO_PENDING. This allows the calling process to continue processing while the write operation is being completed. The event specified in the OVERLAPPED structure is set to the signaled state upon completion of the write operation.

If serial_handle was not opened with FILE_FLAG_OVERLAPPED and lpOverlapped is NULL, the write operation starts at the current file position and WriteFile does not return until the operation has been completed.

The former is asynchoronous and the latter is synchoronous.
about your question,you can invoke "GetOverlappedResult(
HANDLE hFile, // handle to file, pipe, or device
LPOVERLAPPED lpOverlapped, // overlapped structure
LPDWORD lpNumberOfBytesTransferred, // bytes transferred
BOOL bWait // wait option
);" this function to get result of WriteFile();
eg:

success = WriteFil(serial_handle ,&temp,5,&temp1,&overlappRead);
if(!success)
{
DWORD dwErrorCode = GetLastError();
switch(dwErrorCode)
{
case ERROR_IO_PENDING://IO is operating
{
GetOverlappedResult(serial_handle,&overlapped,&temp1,TRUE);
//infinitely wait for WriteFile() operation compelete
break;
}
//others error code
default:
{
break
}
}
}
QuestionQuestion Authentication client-server using message queues in c language Pin
ralph 230-Jul-10 2:47
ralph 230-Jul-10 2:47 
AnswerRe: Question Authentication client-server using message queues in c language Pin
Yusuf30-Jul-10 2:55
Yusuf30-Jul-10 2:55 
AnswerRe: Question Authentication client-server using message queues in c language Pin
Sauro Viti30-Jul-10 2:58
professionalSauro Viti30-Jul-10 2:58 
GeneralRe: Question Authentication client-server using message queues in c language Pin
ralph 230-Jul-10 3:04
ralph 230-Jul-10 3:04 
GeneralRe: Question Authentication client-server using message queues in c language Pin
Richard MacCutchan30-Jul-10 3:23
mveRichard MacCutchan30-Jul-10 3:23 
GeneralRe: Question Authentication client-server using message queues in c language Pin
ralph 230-Jul-10 3:30
ralph 230-Jul-10 3:30 
GeneralRe: Question Authentication client-server using message queues in c language Pin
Cedric Moonen30-Jul-10 3:33
Cedric Moonen30-Jul-10 3:33 
GeneralRe: Question Authentication client-server using message queues in c language Pin
ralph 230-Jul-10 3:40
ralph 230-Jul-10 3:40 
GeneralRe: Question Authentication client-server using message queues in c language Pin
Richard MacCutchan30-Jul-10 3:54
mveRichard MacCutchan30-Jul-10 3:54 
GeneralRe: Question Authentication client-server using message queues in c language Pin
ralph 230-Jul-10 4:05
ralph 230-Jul-10 4:05 
GeneralRe: Question Authentication client-server using message queues in c language Pin
Richard MacCutchan30-Jul-10 6:30
mveRichard MacCutchan30-Jul-10 6:30 
GeneralRe: Question Authentication client-server using message queues in c language Pin
ralph 230-Jul-10 10:54
ralph 230-Jul-10 10:54 
GeneralRe: Question Authentication client-server using message queues in c language Pin
Richard MacCutchan30-Jul-10 22:26
mveRichard MacCutchan30-Jul-10 22:26 
GeneralRe: Question Authentication client-server using message queues in c language Pin
ralph 230-Jul-10 22:47
ralph 230-Jul-10 22:47 
GeneralMessage Removed Pin
1-Aug-10 22:27
SortaCore1-Aug-10 22:27 
GeneralRe: Question Authentication client-server using message queues in c language Pin
Richard MacCutchan1-Aug-10 23:19
mveRichard MacCutchan1-Aug-10 23:19 
QuestionOpening a file with my program Pin
mmagill030-Jul-10 1:58
mmagill030-Jul-10 1:58 

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.