我是靠谱客的博主 大力过客,这篇文章主要介绍CoInitializeEx编译通过的问题,现在分享给大家,希望可以做个参考。

在初始化Com套间的时候,调用CoInitializeEx(NULL, COINIT_MULTITHREADED); 可编译器总是提示编译:

 error C2065: 'CoInitializeEx' : undeclared identifier

error C2065: 'COINIT_MULTITHREADED' : undeclared identifier

最后,在stdafx.h文件中的增加红色代码就可以了。

......

#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0400           //使用CoInitializeEx
#endif

#include <afxwin.h>         // MFC core and standard components
#include <afxext.h>         // MFC extensions
#include <afxcview.h>
#include <afxdisp.h>        // MFC Automation classes
#include <afxdtctl.h>  // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h>   // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT

......

最后

以上就是大力过客最近收集整理的关于CoInitializeEx编译通过的问题的全部内容,更多相关CoInitializeEx编译通过内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(132)

评论列表共有 0 条评论

立即
投稿
返回
顶部