// Todo: Code Your Application's Behavior Here. BSTR BSTRTEXT = :: SysallocString (L "AAAAAAAAAA"); // :: SysallocString (L "TEST"); WPrintf (L "BSTR Text:% S / N", BSTRText) ; char * lpszText2 = :: _ com_util :: ConvertBSTRToString (bstrText); // _ com_util :: ConvertBSTRToString (bstrText); printf ( "char * text:% s / n", lpszText2); SysFreeString (bstrText); delete [] lpszText2 ;
Char * lpsztext = "test"; Printf ("char * text:% s / n", lpsztext); bstr bstrtext2 = _com_util :: converTringTobstr (lpsztext); Wprintf (L "BSTR text:% s / n", bstrtext2) Sysfreestring (bstrtext);