Click here to Skip to main content
15,919,028 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralCComboBox Pin
closecall20-May-04 22:36
closecall20-May-04 22:36 
GeneralRe: CComboBox Pin
closecall20-May-04 22:43
closecall20-May-04 22:43 
GeneralRe: CComboBox Pin
Andrew Quinn AUS20-May-04 22:51
Andrew Quinn AUS20-May-04 22:51 
GeneralOdd effect in .net 2003 using c++forms Pin
hjimmy20-May-04 22:15
hjimmy20-May-04 22:15 
GeneralIdenfy a PC Pin
ivax20-May-04 22:06
ivax20-May-04 22:06 
GeneralRe: Idenfy a PC Pin
Andrew Quinn AUS20-May-04 23:30
Andrew Quinn AUS20-May-04 23:30 
GeneralRe: Idenfy a PC Pin
Dennis Gourjii21-May-04 3:00
Dennis Gourjii21-May-04 3:00 
GeneralSerial Port - overlapped I/O - WaitCommEvent/SetCommMask/ReadFile/etc questions Pin
AnotherProgrammer20-May-04 21:50
AnotherProgrammer20-May-04 21:50 
Sorry for reposting this, but I thought I may get some help now that it's the weekend...

I have now undertaken rewriting the serial portion of my code to use CreateFile and the like. It's all a bit complicated though, and being new to this, I have a few questions. It starts with overlapping, and also involves WaitCommEvent and GetCommMask. I did a search on the topics and read a few articles that were found, but while they cleared a few things up, they still left me with a few questions unanswered.

First, I understand that SetCommMask allows you to screen for only a few of the events. But after calling SetCommMask to look for only what you want, how does one screen for these events and process them appropriately? I know you can use WaitCommEvent, but in that case, why would you even need GetCommMask? I also need to use overlapping for this program, but I'm not sure how to implement it or even what it actually is (do I need to use the overlapped structure at all?).

I was able to find this piece of example code on MSDN: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devio/base/monitoring_communications_events.asp

I do not fully understand how it operates, though.

Also, this article was very helpful, to a point: http://www.codeproject.com/system/serial_com.asp

Where I got lost was the huge block of code where he uses the OVERLAPPED structure and the Threadfn function, after which he writes "If you understood the above code , you will understand the whole of this article and the source code provided." Gulp. Basically, I have trouble understanding what he does there and where that overlapped structure comes into play.

As always, the help is very much appreciated.
GeneralRe: Serial Port - overlapped I/O - WaitCommEvent/SetCommMask/ReadFile/etc questions Pin
Paul Ranson21-May-04 7:37
Paul Ranson21-May-04 7:37 
GeneralC++ object pointers Pin
Anonymous20-May-04 21:47
Anonymous20-May-04 21:47 
GeneralRe: C++ object pointers Pin
Steve S21-May-04 0:20
Steve S21-May-04 0:20 
GeneralRe: C++ object pointers Pin
mirex21-May-04 1:16
mirex21-May-04 1:16 
General"int" to "CY" Pin
Hing20-May-04 21:26
Hing20-May-04 21:26 
GeneralRe: "int" to "CY" Pin
Maxwell Chen20-May-04 21:43
Maxwell Chen20-May-04 21:43 
GeneralRe: "int" to "CY" Pin
Hing20-May-04 21:44
Hing20-May-04 21:44 
GeneralRe: "int" to "CY" Pin
Maxwell Chen20-May-04 23:50
Maxwell Chen20-May-04 23:50 
GeneralRe: "int" to "CY" Pin
Hing20-May-04 23:52
Hing20-May-04 23:52 
GeneralModeless dialog problem Pin
krugger20-May-04 21:26
krugger20-May-04 21:26 
GeneralRe: Modeless dialog problem Pin
Ernesto D.20-May-04 22:36
Ernesto D.20-May-04 22:36 
GeneralHTML help in Visual C++ project Pin
krugger20-May-04 20:51
krugger20-May-04 20:51 
GeneralRe: HTML help in Visual C++ project Pin
Dennis Gourjii21-May-04 3:11
Dennis Gourjii21-May-04 3:11 
GeneralRe: HTML help in Visual C++ project Pin
*Dreamz21-May-04 3:55
*Dreamz21-May-04 3:55 
GeneralHelp!automatically read the file Pin
jfk_lili20-May-04 19:56
jfk_lili20-May-04 19:56 
GeneralRe: Help!automatically read the file Pin
mirex20-May-04 21:23
mirex20-May-04 21:23 
GeneralRe: Help!automatically read the file Pin
Steve S21-May-04 0:29
Steve S21-May-04 0:29 

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.