Pages

Search This Blog

Saturday, July 17, 2010

Convert BSTR to CString

When use CString, remember to include afxwin.h in your header.

BSTR sComPortNumber = "COM1";

//declare CString csComPortNumber and convert BSTR cComPortNumber to CString

CString csComPortNumber(sComPortNumber);

DONE.

No comments: