문제

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?

도움이 되었습니까?

해결책

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. ;-)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top