| Topic: |
DEVELOP > c-Plus-Plus |
| User: |
"Steffen" |
| Date: |
01 Dec 2004 02:01:14 PM |
| Object: |
TimeOut Serial Port |
Hello!
I'm excanging data with an microcontroller (Atmel) via the serial port.
My C++ programm is written in Microsoft Visual Studio .net (7)
I have the following problem:
If I disconnect my controller, then the programm hangs up in the following
line:
WaitCommEvent (m_hCommPort, &dwEvtMask, 0);
Of course it does - but I need to get a TimeOut. After 50 ms the function
should quit and return an timeout message.
Can anybody help me? Would really be great.
Thank you in advance!
Best regards
Steffen
.
|
|
| User: "Victor Bazarov" |
|
| Title: Re: TimeOut Serial Port |
01 Dec 2004 02:12:06 PM |
|
|
Steffen wrote:
I'm excanging data with an microcontroller (Atmel) via the serial port.
My C++ programm is written in Microsoft Visual Studio .net (7)
I have the following problem:
If I disconnect my controller, then the programm hangs up in the following
line:
WaitCommEvent (m_hCommPort, &dwEvtMask, 0);
Of course it does - but I need to get a TimeOut. After 50 ms the function
should quit and return an timeout message.
Can anybody help me? Would really be great.
AFAICT, 'WaitCommEvent' is not a standard C++ function. Your best bet is
to ask about it in a newsgroup dedicated to your OS or your compiler. For
VC++.NET try comp.os.ms-windows.programmer.* or microsoft.public.vc.*
V
.
|
|
|
| User: "Steffen" |
|
| Title: Re: TimeOut Serial Port |
01 Dec 2004 02:28:53 PM |
|
|
Thank you very much!
I will try it in an other newsgroup.
Steffen
.
|
|
|
|
|

|
Related Articles |
|
|