Click here to Skip to main content
15,908,173 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: _inp and _outp Pin
21-May-04 12:29
suss21-May-04 12:29 
GeneralRe: _inp and _outp Pin
Prakash Nadar21-May-04 16:45
Prakash Nadar21-May-04 16:45 
GeneralRe: _inp and _outp Pin
eggie521-May-04 18:17
eggie521-May-04 18:17 
GeneralStrFormatByteSize() Pin
DanYELL21-May-04 9:29
DanYELL21-May-04 9:29 
GeneralRe: StrFormatByteSize() Pin
Michael Dunn21-May-04 12:57
sitebuilderMichael Dunn21-May-04 12:57 
GeneralRe: StrFormatByteSize() Pin
DanYELL21-May-04 15:20
DanYELL21-May-04 15:20 
QuestionCorrect Usage of WaitCommEvent? Pin
AnotherProgrammer21-May-04 8:31
AnotherProgrammer21-May-04 8:31 
AnswerFurthermore... (another question - about ReadFile this time) Pin
AnotherProgrammer21-May-04 8:40
AnotherProgrammer21-May-04 8:40 
The ReadFile function also has me a bit concerned.

Assuming WaitCommEvent works, and the "event" is that a character has been received (EV_RXCHAR), would this piece of code output the character that was received (data)?

OVERLAPPED obj;
BOOL fsuccess;
HANDLE hCom;
BYTE data;
DWORD event = EV_RXCHAR;
DWORD transferred;

// ...
// Open the port, give the correct settings, 
// ...

if (WaitCommEvent(hCom, &event, &obj))
{
      cout << "IT DETECTED SOMETHING! ";
      fsuccess = ReadFile (hCom, &data, 1, &transferred, &obj);
      if (fsuccess)
      {
           cout << "IT READ A CHARACTER: " << data;
      }
      getch();
}</code>


Oh, in both of the above programs, the serial port is constantly being fed data continuously. Thanks for any help.
AnswerRe: Correct Usage of WaitCommEvent? Pin
Antti Keskinen23-May-04 0:08
Antti Keskinen23-May-04 0:08 
GeneralSubclassed ActiveX control Pin
BlackDice21-May-04 7:01
BlackDice21-May-04 7:01 
GeneralRe: Subclassed ActiveX control Pin
Antti Keskinen21-May-04 7:44
Antti Keskinen21-May-04 7:44 
GeneralRe: Subclassed ActiveX control Pin
BlackDice21-May-04 7:58
BlackDice21-May-04 7:58 
GeneralWTL links Pin
aej21-May-04 5:33
aej21-May-04 5:33 
QuestionHow to retrieve UNIT of a scroll bar Pin
fotoONE21-May-04 5:10
fotoONE21-May-04 5:10 
AnswerRe: How to retrieve UNIT of a scroll bar Pin
David Crow21-May-04 5:14
David Crow21-May-04 5:14 
AnswerRe: How to retrieve UNIT of a scroll bar Pin
vladfein21-May-04 6:58
vladfein21-May-04 6:58 
GeneralCStrings Pin
Anonymous21-May-04 5:09
Anonymous21-May-04 5:09 
GeneralRe: CStrings Pin
David Crow21-May-04 5:16
David Crow21-May-04 5:16 
GeneralRe: CStrings Pin
Michael Dunn21-May-04 5:17
sitebuilderMichael Dunn21-May-04 5:17 
Generalvalidity of HTREEITEM Pin
Paolo Vernazza21-May-04 4:49
Paolo Vernazza21-May-04 4:49 
GeneralRe: validity of HTREEITEM Pin
vladfein21-May-04 6:54
vladfein21-May-04 6:54 
GeneralRe: validity of HTREEITEM Pin
peterchen21-May-04 22:53
peterchen21-May-04 22:53 
GeneralRe: validity of HTREEITEM Pin
Paolo Vernazza21-May-04 23:37
Paolo Vernazza21-May-04 23:37 
Questionhow to connect mysql database with mfc? Pin
Chooikw21-May-04 4:14
Chooikw21-May-04 4:14 
AnswerRe: how to connect mysql database with mfc? Pin
AAntix21-May-04 4:45
AAntix21-May-04 4:45 

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.