Author Topic: Program crashes on start up...  (Read 18421 times)

GlennP

  • Frequent Contributor
  • ****
  • Posts: 141
Program crashes on start up...
« 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
   

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Program crashes on start up...
« Reply #1 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.