Binary reception problem of serial communication

zhaozj2021-02-16  171

I use a text method to receive serial port information, but there is a binary data in the received information. How can I receive this paragraph, thus converting it into a 16-based? I don't know what type of this binary data VARIANT type is transformed? Is there any other method?

// Interception to the serial input information of the specified string

STRINPUT.EMPTY ();

While (BL)

{

IF (m_com.getinbuffercount ()> 0)

{

Colevariant M_OLEVARIANTSTR (m_com.getinput ());

m_olevariantstr.vt = vt_bstr;

STRINPUT = M_OLEVARIANTSTR.BSTRVAL;

IF (Strinput.Find (">")! = -1)

{

AfxMessageBox;

BL = FALSE;

}

}

Else

Doevents ();

}

Here BSTR doesn't seem to be, because BSTR is unicode, there is 00 in my data.

Thank you for your heroes.

转载请注明原文地址:https://www.9cbs.com/read-8052.html

New Post(0)