프로그래밍(Programming)/c++, 11, 14 , 17, 20
char 을 BSTR 로 변환
3DMP
2012. 10. 31. 17:35
BSTR IString::ToBSTR()
{
BSTR BStr;
int iWLength;
iWLength = ::MultiByteToWideChar(CP_ACP, 0, mcpStr, Length(), NULL,
NULL);
BStr = ::SysAllocStringLen(NULL,
iWLength);
::MultiByteToWideChar(CP_ACP, 0, mcpStr, Length(), BStr,
iWLength);
return BStr;
}
반응형