I wonder if someone could shed some light onto this....
I'm running a Non-UI Application that opens a COM port on a PC. The Application works great. However, if I terminate the application with a CONTROL-C, the COM Port remains open and subsequently running the same program again (or any other program that opens the same port) will produce the error saying that the COM port is already open by another application.
I realize that I should close the COM port in my Application before I terminate the program. However, how do I trap a CONTROL-C in the program and close the COM Port before the program terminates?
Thanks for any advise!
I'm running a Non-UI Application that opens a COM port on a PC. The Application works great. However, if I terminate the application with a CONTROL-C, the COM Port remains open and subsequently running the same program again (or any other program that opens the same port) will produce the error saying that the COM port is already open by another application.
I realize that I should close the COM port in my Application before I terminate the program. However, how do I trap a CONTROL-C in the program and close the COM Port before the program terminates?
Thanks for any advise!