Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#16 Unhandled Exception when no ports in system

open
nobody
None
5
2006-02-04
2006-02-04
Anonymous
No

Whene there are no ports available to Windows, ComPort
library crashes. Reason:

In CportCtl.pas:

// select port property
procedure TComSelect.SelectPort;
begin
Items.Clear;
EnumComPorts(Items);
end;

Call to EnumComPorts() will throw an exception. This
exception is not caught in SelectPort.

The change below should be sufficient:

// select port property
procedure TComSelect.SelectPort;
begin
Items.Clear;
try
EnumComPorts(Items);
except
end;
end;

Discussion