I have to connect and send hexadecimal commands on the COM port in the C++ code to the UART converter but I'm stuck with the code.

I believe I have to open the port, write and close. That's what I've managed to determine.

I've already scouted through the internet in and out but every code I managed to find didn't work.

Could anyone help me? I'm really stuck