UuidToString在ATL的问题,在线等待

nbt 2003-06-12 09:17:19
我有以下程序在debug时编译是成功,但在unicode release minize时提示错误
BYTE *uuid;
GUID Guid;
CComBSTR bstrTemp;
bstrTemp.AppendBSTR(bstrDirPath);
bstrTemp.Append("\\filepath\\");
CoCreateGuid(&Guid);
UuidToString(&Guid,&uuid);
bstrTemp.Append((LPCSTR)uuid);
bstrTemp.Append(".xml");
RpcStringFree(&uuid);

错误如下:
error C2664: 'UuidToStringW' : cannot convert parameter 2 from 'unsigned char ** ' to 'unsigned short ** '
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

error C2664: 'RpcStringFreeW' : cannot convert parameter 1 from 'unsigned char ** ' to 'unsigned short ** '
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
...全文
104 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
Earthdog 2003-06-12
  • 打赏
  • 举报
回复
补充一下
最好是改成
TCHAR* uuid
Earthdog 2003-06-12
  • 打赏
  • 举报
回复
那是Unicode字符串和非Unicode字符串之间的问题,你把
BYTE* uuid
的定义改成
WCHAR* uuid
就可以了
nbt 2003-06-12
  • 打赏
  • 举报
回复
象这类问题很多,我想道理应该是相同的了
我还有个问题:
为什么我用atl写的com+程序,配置到进程内,asp程序调用,有时会出现dllhost错误,是什么原因呢,望指教!
nbt 2003-06-12
  • 打赏
  • 举报
回复
8错8错,谢谢!

3,245

社区成员

发帖
与我相关
我的任务
社区描述
ATL,Active Template Library活动(动态)模板库,是一种微软程序库,支持利用C++语言编写ASP代码以及其它ActiveX程序。
社区管理员
  • ATL/ActiveX/COM社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧