Hi all, haven't been here for a while :-)
I have a program that reads the available COM ports from the Windows 10 registry (at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM\ ). It uses the TRegistry class with the usual methods (OpenKeyReadOnly, GetValueNames, ReadString etc.)
The program worked well for a long time, but at some point something changed (external to the program). I traced the issue to an Arduino clone with the CH340G USB-to-UART chip. The screenshot shows actual data from the registry. You can see two COM ports there: COM21 (key name '\Device\USBSER001') and COM3 ('\Device\Serial').
In my program, both keys are found, and the string 'COM21' is read correctly; it's associated with another Arduino with a different chip. However, for the other key I get an empty string instead of 'COM3'.
Windows itself, the Arduino IDE and a test program I wrote in Delphi all see and handle this 'COM3' string with no problem, but Lazarus can't read it.
I suspect that it's an encoding issue because the raw key name in Lazarus actually appears as '\Device\Serial?', and the Delphi debug watch said it's '\Device\Serial'#$0082 . So far I couldn't find a character to remove or add that will resolve this issue.
If you're still with me
- any idea on how to tackle this matter?
Thanks,