ATL自动生成的双端口 编译出错 大哥们 帮我看看啊

kitigesh 2005-12-10 12:46:45
D:\haha\haha.cpp(326) : error C2259: 'Chaha' : cannot instantiate abstract class due to following members:
d:\haha\haha.h(11) : see declaration of 'Chaha'
D:\haha\haha.cpp(326) : warning C4259: 'long __stdcall Chaha::QueryInterface(const struct _GUID &,void ** )' : pure virtual function was not defined
d:\haha\haha.h(42) : see declaration of 'QueryInterface'
D:\haha\haha.cpp(326) : warning C4259: 'unsigned long __stdcall Chaha::AddRef(void)' : pure virtual function was not defined
d:\haha\haha.h(42) : see declaration of 'AddRef'
D:\haha\haha.cpp(326) : warning C4259: 'unsigned long __stdcall Chaha::Release(void)' : pure virtual function was not defined
d:\haha\haha.h(42) : see declaration of 'Release'
D:\haha\haha.cpp(326) : error C2259: 'Chaha' : cannot instantiate abstract class due to following members:
d:\haha\haha.h(11) : see declaration of 'Chaha'
D:\haha\haha.cpp(326) : warning C4259: 'long __stdcall Chaha::QueryInterface(const struct _GUID &,void ** )' : pure virtual function was not defined
d:\haha\haha.h(42) : see declaration of 'QueryInterface'
D:\haha\haha.cpp(326) : warning C4259: 'unsigned long __stdcall Chaha::AddRef(void)' : pure virtual function was not defined
d:\haha\haha.h(42) : see declaration of 'AddRef'
D:\haha\haha.cpp(326) : warning C4259: 'unsigned long __stdcall Chaha::Release(void)' : pure virtual function was not defined
d:\haha\haha.h(42) : see declaration of 'Release'

大家帮我看看啊 Chaha里面包括了一个双端口的COM,这个接口是用VC插入的
我也尝试自己再添加 AddRef Release QueryInterface的实现代码
可是还是报这些 纯虚函数没有定义的错误
按道理 不会啊 而且模板已经自己生成了上述几个函数的定义 都不用我自己添代码的啊

谢谢各位大哥了,帮帮小弟!
...全文
74 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
吹泡泡的小猫 2005-12-10
  • 打赏
  • 举报
回复
用midl.exe编译接口文件,然后将生成的cpp和h文件加入工程
方工 2005-12-10
  • 打赏
  • 举报
回复
The com object can not declared like this:
Chaha m_haha;
instead, it should declared as:
CComPtr<Ixxxx> m_pHaha;
kitigesh 2005-12-10
  • 打赏
  • 举报
回复
编译了也不行啊 照样解决不了
kitigesh 2005-12-10
  • 打赏
  • 举报
回复
楼上的兄弟 怎么编译啊?
我是新手!
感谢!

3,245

社区成员

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

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