Identifying which COM port has been assigned to a USB-to-serial adapter based on the FTDI chip
Posted on 2005-03-15
We have a legacy product that uses a USB-to-COM port chip from FTDI to provide a COM port that our app (written in D5) can use. What I am wanting to do is to identify at run-time what COM port the FTDI device has been assigned to so that I can relieve the user of the need to look in device manager and set the COM port accordingly. I will also hook into the message that fires when a USB device change is detected and use that to re-assign the COM port on the fly.
I'm just wondering where the proper place to poke around is to get the COM port number - the registry seems the most likely candidate - but there seem to be several registry entries that have the COM port in them, but some of them are there even when the device isn't plugged in.
I realise it's not too much to do with Delphi but it seemded like a good place to ask.