I use TCommport library for serial comms, all have been well until the advent of USB, what can happen with the driver is that if the USB connection is lost, the driver cannot cleanly close the Virtual Port.
The user sees an error message 'Purge comm function failed'
This isn't good, and usually the only way to get things going again is by restarting the application.
I have been following a forum on the sourceforges pages for the driver.
this is all fine except that the final code solution posted seems to me to close the port OK but leaves the exception unhandled, so the user will still see the 'purge comm failed message', I would like to replace this with something more meaningful.
Would this work?
Steve: N.M.N.F.
If something is popular, it must be wrong: Mark Twain
The user sees an error message 'Purge comm function failed'
This isn't good, and usually the only way to get things going again is by restarting the application.
I have been following a forum on the sourceforges pages for the driver.
this is all fine except that the final code solution posted seems to me to close the port OK but leaves the exception unhandled, so the user will still see the 'purge comm failed message', I would like to replace this with something more meaningful.
Would this work?
Code:
type
EAbortErrror = class(Exception);
//--------------------------
try
try
AbortAllAsync;
except
raise EAbortError.Create('USB Connection Lost, don''t panic');
end
finally
// stop monitoring for events
if FThreadCreated then
begin
etc...
end
// and close the port
end
Steve: N.M.N.F.
If something is popular, it must be wrong: Mark Twain