PORTS Forum

Ports and Interfaces => Serial Ports => Topic started by: GlennP on October 23, 2012, 04:29:31 am

Title: Program crashes on start up...
Post by: GlennP on October 23, 2012, 04:29:31 am
Hi All,
Odd one I have written a program to communicate with some boards my firm has shipped. Works fine all the testing I have done. However there is an issue if the machine has no com ports it crashes,
I'm wondering if the problem can be solved by performing a GetPortNames(); Page 219 of Serial Port Complete sorry being kicked off the machine I'm using will carry on when I get chance.

Glenn
   
Title: Re: Program crashes on start up...
Post by: Jan Axelson on October 23, 2012, 10:13:30 pm
Yes, it can be helpful to verify that a port exists before trying to open it. Or add an error handler to deal with errors due to trying to open a non-existing port.