【发布时间】:2010-11-30 09:27:24
【问题描述】:
我有以下方法:
VariantFromString(strXMLPath ,vXMLSource);
方法的签名是:
HRESULT VariantFromString(PCWSTR wszValue, VARIANT &Variant);
现在,当我传递如下 CString 时:
char cCurrentPath[FILENAME_MAX];
if (!GetCurrentDir(cCurrentPath, sizeof(cCurrentPath)))
{
return errno;
}
CString strXMLPath = cCurrentPath;
strXMLPath += XMLFILE;
VariantFromString(strXMLPath ,vXMLSource);
我收到错误:无法从 CString 转换为 PCWSTR
【问题讨论】:
标签: c++ windows type-conversion