Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

How to send UNICODE characters to serial port

$
0
0

I am trying to write data in Russian language to the serial (RS-232) port. My display device is already set to that character code page. 

But output on the device is not exactly what I require.

My code snippet is like this below

CString pBuffer = L"английский"; //Russian Language
LPBYTE pByte = new BYTE[pBuffer.GetLength() + 1];
memcpy(pByte, (VOID*)LPCTSTR(pBuffer), pBuffer.GetLength());
long nBuffer=pBuffer.GetLength()+1;
DWORD dwWritten=0;
WriteFile(pHandle , pByte, nBuffer ,&dwWritten , NULL);

pHandle is a valid handle.

Waiting for valuable response of yours. Welcome in case of any further information.


Viewing all articles
Browse latest Browse all 15302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>