C++后端向JS前端转换
生活随笔
收集整理的這篇文章主要介紹了
C++后端向JS前端转换
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
需要包含的頭文件
#include"comutil.h"
#include"<string>
? ? ? ? ? ? ? ? BSTR轉string
?? ?BSTR bstrText = ::SysAllocString(L"Test");
?? ?string str = _com_util::ConvertBSTRToString(bstrText);
?? ?SysFreeString(bstrText);
? ? ? ? ? ? ? ?string轉BSTR
const char* test="hello"
string str = test;?
BSTR bstrText = _com_util::ConvertStringToBSTR(str); ?//str為const char* 類型
c_str( ) //string 轉const char*
總結
以上是生活随笔為你收集整理的C++后端向JS前端转换的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 股票除权除息后买卖要交税吗?
- 下一篇: 工行补卡需要去开户行吗?