1

I'm working on a graphical COM port monitor in FreeBASIC, but I feel kinda wrong re-compiling every time I change the computer or the adapter. Is there any way to scan for an available COM port in FreeBASIC?

Simon Mourier
  • 132,049
  • 21
  • 248
  • 298
Paul
  • 43
  • 4

1 Answers1

1

You can get a list of the ports available using the Win32 API function EnumPorts or you can check the registry branch HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM.

The following two code snippets illustrate the two ways mentioned above:

Unfortunately, the code snippet pages are in German but the given source codes, of course, will work on non German systems, too. ;-)

MrSnrub
  • 1,123
  • 1
  • 11
  • 19