Application hangs when trying to open comport
-
Hi all, Iam facing some strange problem with my application. My application uses Comport to communciate with the device. If my application only opened, I can open the serial port and close the port without any problem. If I open my application and just close the serialport and open hyperterminal and connect it , after some work on hyperterminal again i want to switch to my application by disconnecting hyperterminal. When I am opening the port again in my application my application hangs, When it calls any API of comport like, SetCommState()as it is never returning from it. Why application is hanging when hypertermianl opened and closed in between applciation open uart and close uart. Thanks in advance..
Regards, Sunil Kumar
-
Hi all, Iam facing some strange problem with my application. My application uses Comport to communciate with the device. If my application only opened, I can open the serial port and close the port without any problem. If I open my application and just close the serialport and open hyperterminal and connect it , after some work on hyperterminal again i want to switch to my application by disconnecting hyperterminal. When I am opening the port again in my application my application hangs, When it calls any API of comport like, SetCommState()as it is never returning from it. Why application is hanging when hypertermianl opened and closed in between applciation open uart and close uart. Thanks in advance..
Regards, Sunil Kumar
How do you open the device? Or in other words: what does your call to
::CreateFile()
look like? (Post the code.) Whenever you're developing software that communicates with communications port, it's usually very nice to have an application that tells you what is going on under the hood. I always use PortMon[^] written by Mark Russinovich. It will tell you exactly what Hyperterminal and your application is doing."It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown -
Hi all, Iam facing some strange problem with my application. My application uses Comport to communciate with the device. If my application only opened, I can open the serial port and close the port without any problem. If I open my application and just close the serialport and open hyperterminal and connect it , after some work on hyperterminal again i want to switch to my application by disconnecting hyperterminal. When I am opening the port again in my application my application hangs, When it calls any API of comport like, SetCommState()as it is never returning from it. Why application is hanging when hypertermianl opened and closed in between applciation open uart and close uart. Thanks in advance..
Regards, Sunil Kumar
It may happen if your application (wrongly) relies on some initial state of the serial device (and the Hyperterminal alters it). As remarked by Roger Stoltz, without posting the relevant code, you hardly will get any help. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]