WTL工程中出现运行“Did you forget to pass the LIBID to CComModule::Init”的解决方法
来源:互联网 发布:原生js实现加载更多 编辑:程序博客网 时间:2024/06/06 01:09
我在使用VS2005开发WTL项目的时候,在运行的时候出现一个ALERT提示,提示内容如下:
---------------------------
Microsoft Visual C++ Debug Library
---------------------------
Debug Assertion Failed!
Program: e:/project/ietools/shinedoo/shinedoo/Debug/shinedoo.exe
File: d:/program files/microsoft visual studio 8/vc/atlmfc/include/atlcom.h
Line: 3751
Expression: !InlineIsEqualGUID(*m_plibid, GUID_NULL) && "Did you forget to pass the LIBID to CComModule::Init?"
For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.
问题原因:
我们从提示的语句中很容易看到,这是一个GUID_NULL造成的错误。所以我检查代码之后,是工程模块加载方法CComModule::Init需要三个参数,第三个参数GUID如果为默认的NULL,编译通过,但是运行的时候出现了以上的一个ASERT提示,我们找到调用这个的地方,是在winmain(_tWinMain)函数调用的。
解决方法:
在winmain(_tWinMain)中找到如下代码
hRes = _Module.Init(NULL, hInstance);
修改成
GUID guid;
hRes = _Module.Init(NULL, hInstance, &guid);
修改后,编译通过,运行成功!
- WTL工程中出现运行“Did you forget to pass the LIBID to CComModule::Init”的解决方法
- WTL工程中出现运行“Did you forget to pass the LIBID to CComModule::Init”的解决方法
- WTL出现GUID错误 Did you forget to pass the LIBID to CComModule::Init?
- WTL出现GUID错误 Did you forget to pass the LIBID to CComModule::Init?
- file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it 的解决
- Unable to find the socket transport 'ssl' - did you forget to enable it when you configured
- Android上下TabHost设置及Did you forget to call 'public void setup(LocalActivityManager activityGroup)解决方法
- Android上下TabHost设置及Did you forget to call 'public void setup(LocalActivityManager activityGroup)解决方法
- Unable to find the socket transport 'ssl' - did you forget to enable it when you configured PHP?
- did you forget to add stdafx.h problem
- Warning: fopen() [function.fopen]: Unable to find the wrapper “https” – did you forget to enable it
- 如何快速解决TeXstudio提示的错误:did you pass the "backend=biber" option to BibLaTeX?
- VS2005,Did you forget to add '#include "stdafx.h"' to your source?
- VS2005,Did you forget to add '#include "stdafx.h"' to your source?
- VS2005,Did you forget to add '#include "stdafx.h"' to your source?
- VS2005,Did you forget to add '#include "stdafx.h"' to your source?
- Did you forget to add '#include "stdafx.h"' to your source?
- No source code is available for type javax.validation.ConstraintViolation<T>; did you forget to inh
- Windows Socket 网络编程(一) —— TCP/IP体系结构、特点及相关术语
- 青年人必须尝试的30件事
- 解读session
- C#读取记事本内容进行分类问题
- S2-即将到来的考试
- WTL工程中出现运行“Did you forget to pass the LIBID to CComModule::Init”的解决方法
- JS控制浏览器导航的几种方法
- Cookie欺骗原理
- 数字导出到csv 格式改变
- 读取XML网页文件
- 使用DAO View 和 DAOTAble遇到的问题
- 数据库邮件配置要点
- 轻松几步获得上万点击率(三)
- 工作中如何提高自己的能力?