在线程函数中调用CoInitializeEx编译出错

Breeze 2005-12-31 10:14:56
编译的时候报了错
error C2039: 'CoInitializeEx' : is not a member of '`global namespace''
error C2065: 'CoInitializeEx' : undeclared identifier

另外,这是在vc6下通不过,vc2003就能通过
可是调用CoInitialize编译就能通过,那位大侠知道的,指点一下
...全文
171 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
DentistryDoctor 2006-01-01
  • 打赏
  • 举报
回复
MSDN真是好东东呀。
Breeze 2005-12-31
  • 打赏
  • 举报
回复
呵呵,找到问题了,细看了一下msdn,发现有一句话:

Note You must include the #define _WIN32_DCOM preprocessor directive at the beginning of your code to be able to use CoInitializeEx

问题解决了
蒋晟 2005-12-31
  • 打赏
  • 举报
回复
Somewhere before that ill-fated usage, write
#define _WIN32_WINNT 0x0500
#include <ole2.h>

15,471

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 进程/线程/DLL
社区管理员
  • 进程/线程/DLL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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