Click here to Skip to main content
15,891,136 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: retruning NULL in Handle Pin
neha.agarwal2714-Jun-07 0:23
neha.agarwal2714-Jun-07 0:23 
AnswerRe: retruning NULL in Handle Pin
Rajkumar R14-Jun-07 19:14
Rajkumar R14-Jun-07 19:14 
AnswerRe: retruning NULL in Handle Pin
Jijo.Raj13-Jun-07 21:54
Jijo.Raj13-Jun-07 21:54 
GeneralRe: retruning NULL in Handle Pin
neha.agarwal2714-Jun-07 0:24
neha.agarwal2714-Jun-07 0:24 
GeneralRe: retruning NULL in Handle Pin
Jijo.Raj15-Jun-07 1:13
Jijo.Raj15-Jun-07 1:13 
QuestionRe: retruning NULL in Handle Pin
David Crow14-Jun-07 2:54
David Crow14-Jun-07 2:54 
QuestionCan't Write Data To COM Port Pin
sungtany13-Jun-07 20:53
sungtany13-Jun-07 20:53 
AnswerRe: Can't Write Data To COM Port Pin
Roger Stoltz13-Jun-07 23:17
Roger Stoltz13-Jun-07 23:17 
sungtany wrote:
But While ThreadRcv is running( Blocked WaitCommEvent Func ), Any attempt to send Data To COM PORT doesn't work. ( Blocked In WriteFile(...) )


Of course, since you're not using overlapped I/O.
If you don't use overlapped I/O the driver only handles one IRP at a time, which means e.g. that a write operation will block while waiting for a read operation to timeout.
In this case it is essential that you set the COMMTIMEOUTS to make a read operation timeout within a time frame that suits your needs.

I would try the following:
Spawn a worker thread that read data from queue containing data to be sent.
The worker thread would examine the queue if it contains data it would be sent.
Issue a read operation that will eventually time out, the read data should be put in a queue containing received data and the main thread should be notified with a user defined message that some data has been received. Then the main thread can extract the read data from the queue and do whatever needs to be done with the data.


"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown

GeneralRe: Can't Write Data To COM Port Pin
sungtany14-Jun-07 3:31
sungtany14-Jun-07 3:31 
QuestionWarnings Pin
tom groezer13-Jun-07 20:18
tom groezer13-Jun-07 20:18 
AnswerRe: Warnings Pin
Paresh Chitte13-Jun-07 20:51
Paresh Chitte13-Jun-07 20:51 
AnswerRe: Warnings Pin
BadKarma13-Jun-07 20:55
BadKarma13-Jun-07 20:55 
AnswerRe: Warnings Pin
prasad_som13-Jun-07 21:13
prasad_som13-Jun-07 21:13 
Questionvideo recording using directX SDK Pin
tyagineha13-Jun-07 18:44
tyagineha13-Jun-07 18:44 
AnswerRe: video recording using directX SDK Pin
Hamid_RT13-Jun-07 19:30
Hamid_RT13-Jun-07 19:30 
Questionflushing page file Pin
vasu_sri13-Jun-07 18:35
vasu_sri13-Jun-07 18:35 
AnswerRe: flushing page file Pin
SandipG 13-Jun-07 18:43
SandipG 13-Jun-07 18:43 
QuestionHow to Enable the menu item Pin
vikramkarthik13-Jun-07 18:21
vikramkarthik13-Jun-07 18:21 
AnswerRe: How to Enable the menu item Pin
SandipG 13-Jun-07 18:38
SandipG 13-Jun-07 18:38 
AnswerRe: How to Enable the menu item Pin
Hamid_RT13-Jun-07 19:28
Hamid_RT13-Jun-07 19:28 
QuestionTrying to delete a pointer to a template class with only its memory address Pin
Cyrilix13-Jun-07 16:51
Cyrilix13-Jun-07 16:51 
Questionneed help Pin
gentleguy13-Jun-07 16:49
gentleguy13-Jun-07 16:49 
AnswerRe: need help Pin
Garth J Lancaster13-Jun-07 16:58
professionalGarth J Lancaster13-Jun-07 16:58 
AnswerRe: need help Pin
Hamid_RT13-Jun-07 19:24
Hamid_RT13-Jun-07 19:24 
QuestionIntercept Outgoing Port 80 Pin
zx2c413-Jun-07 11:02
zx2c413-Jun-07 11:02 

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.