Click here to Skip to main content
15,914,608 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Mathematics question Pin
Selvam R13-Jan-05 0:15
professionalSelvam R13-Jan-05 0:15 
GeneralRe: Mathematics question Pin
Iain Clarke, Warrior Programmer13-Jan-05 5:16
Iain Clarke, Warrior Programmer13-Jan-05 5:16 
GeneralRe: Mathematics question Pin
Rassul Yunussov18-Jan-05 19:59
Rassul Yunussov18-Jan-05 19:59 
GeneralRe: Mathematics question Pin
Iain Clarke, Warrior Programmer18-Jan-05 22:50
Iain Clarke, Warrior Programmer18-Jan-05 22:50 
QuestionPush Button Properies-Icon prompt? Pin
José Luis Sogorb12-Jan-05 23:57
José Luis Sogorb12-Jan-05 23:57 
AnswerRe: Push Button Properies-Icon prompt? Pin
Selvam R13-Jan-05 0:05
professionalSelvam R13-Jan-05 0:05 
GeneralRe: Push Button Properies-Icon prompt? Pin
José Luis Sogorb13-Jan-05 23:18
José Luis Sogorb13-Jan-05 23:18 
Generalreading from serial port Pin
doneirik12-Jan-05 23:37
doneirik12-Jan-05 23:37 
Hi,

OS:Win2000
using VC++ .NET 2003

I have some sample code (from msdn) to read and write to the serial port. The code works perfectly when I put it into a console program. However, when I put excactly the same code into an Windows Form Application the program "hangs" at the reading routines. Do other reading routines apply to Windows Forms Applications? I simply can´t understand why it doesn´t work...

BYTE Byte;<br />
DWORD dwBytesTransferred;<br />
<br />
// Specify a set of events to be monitored for the port.<br />
SetCommMask (hPort, EV_RXCHAR | EV_CTS | EV_DSR | EV_RLSD | EV_RING);<br />
<br />
while (hPort != INVALID_HANDLE_VALUE) <br />
{<br />
  // Wait for an event to occur for the port.<br />
  WaitCommEvent (hPort, &dwCommModemStatus, 0);<br />
<br />
  // Re-specify the set of events to be monitored for the port.<br />
  SetCommMask (hPort, EV_RXCHAR | EV_CTS | EV_DSR | EV_RING);<br />
<br />
  if (dwCommModemStatus & EV_RXCHAR) <br />
  {<br />
    // Loop for waiting for the data.<br />
    do <br />
    {<br />
      // Read the data from the serial port.<br />
      ReadFile (hPort, &Byte, 1, &dwBytesTransferred, 0);<br />
<br />
      // Display the data read.<br />
      if (dwBytesTransferred == 1)<br />
        this->label1->Text = S"string";<br />
<br />
    } while (dwBytesTransferred == 1);<br />
  }

GeneralRe: reading from serial port Pin
Blake Miller13-Jan-05 4:38
Blake Miller13-Jan-05 4:38 
Questionhow to get a running application Pin
spiced12-Jan-05 23:31
spiced12-Jan-05 23:31 
AnswerRe: how to get a running application Pin
Selvam R12-Jan-05 23:42
professionalSelvam R12-Jan-05 23:42 
GeneralRe: how to get a running application Pin
spiced13-Jan-05 0:16
spiced13-Jan-05 0:16 
GeneralRe: how to get a running application Pin
ThatsAlok13-Jan-05 0:51
ThatsAlok13-Jan-05 0:51 
GeneralRe: how to get a running application Pin
spiced13-Jan-05 17:07
spiced13-Jan-05 17:07 
GeneralRe: how to get a running application Pin
ThatsAlok13-Jan-05 18:47
ThatsAlok13-Jan-05 18:47 
GeneralApplication fails in Release mode.... Pin
Jagadeesh VN12-Jan-05 23:27
Jagadeesh VN12-Jan-05 23:27 
GeneralRe: Application fails in Release mode.... Pin
PJ Arends13-Jan-05 6:55
professionalPJ Arends13-Jan-05 6:55 
GeneralThanks Blake Miller: CreateProcess and process groups (2) Pin
ionzarate12-Jan-05 23:16
ionzarate12-Jan-05 23:16 
GeneralGet Sector!! !! Pin
LiYS12-Jan-05 22:57
LiYS12-Jan-05 22:57 
GeneralRe: Get Sector!! !! Pin
Selvam R12-Jan-05 23:06
professionalSelvam R12-Jan-05 23:06 
GeneralRe: Get Sector!! !! Pin
LiYS12-Jan-05 23:13
LiYS12-Jan-05 23:13 
GeneralRe: Get Sector!! !! Pin
Anonymous12-Jan-05 23:32
Anonymous12-Jan-05 23:32 
Generalrequest to all Pin
Anonymous12-Jan-05 22:11
Anonymous12-Jan-05 22:11 
GeneralRe: request to all Pin
ThatsAlok13-Jan-05 0:30
ThatsAlok13-Jan-05 0:30 
Generalto alok Pin
Anonymous13-Jan-05 1:39
Anonymous13-Jan-05 1:39 

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.