ConvertBSTRTSTRING

xiaoxiao2021-03-06  39

// 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);

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

New Post(0)