Serial monitor like in IDE in my C++ win 10 app

hi to all, i have a task that need to make a windows app serial monitor with embarcadero C++ RAD STUDIO 11 for receive a text data, hex, all types from arduino micro. i try to make some windows app but not success, show in picture

when using other serial terminals like COOL TERM, teraterm, etc. all is fine like next pictures
Cool_TERM_WORK_FINE|632x500

Cool_TERM_WORK_FINE1|650x500

all code in arduino micro works fine, no problem. can someone give a example in C++ for embarcadero rad studio 10 or 11 to can make my serial monitor app for win 10
thanks in advance

Set the encoding of the Serial input to Ansi, not Unicode. The default Char and String type is Unicode (UTF-16), but the Arduino sends single byte characters. You have to convert both Serial input and output between Unicode (C++) and Ansi (Arduino).

i try to make some own encoding code for my program, but no success. can you give some code example to see how to make it properly in my source. it is very hard and have so many variants to convert between different code pages. thanks in front

Sorry, I can't help you in detail. Some time ago I explored Delphi XE and found the non-Unicode stuff very fragile. If you use a TStream (descendant) for COM communication then you should find an Encoding property there which you can set to the desired code page.

For Encoding conversion use variables of the proper encoding and only copy chars or strings between Ansi and Unicode variables. All kind of other mixed encoding expressions is error prone.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.