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