ATL simple object wizard - quot;Object Xxx already existsquot; error(ATL 简单对象向导 - “对象 Xxx 已存在错误)
问题描述
我正在尝试使用 Visual Studio 2005 中的 ATL 简单对象向导在我的 DLL 中创建一个新的 COM 对象.
I am attempting to create a new COM object in my DLL using the ATL Simple Object Wizard in Visual Studio 2005.
我输入对象的短名称,所有其他字段都是派生的.
I enter the short name for the object, and all of the other fields are derived.
但是,当我在向导中单击下一步时,出现以下错误消息:
However, when I click Next in the wizard, the following error message comes up:
Object 'IXxxInterfaceName' already exists
我在整个解决方案中搜索了对 IXxxInterfaceName 的所有引用,但在任何地方都看不到它的定义.
I have searched my entire solution for all references to IXxxInterfaceName and can't see it defined anywhere.
向导如何确定它已经存在?
How is the wizard determining that it exists already?
推荐答案
我从来不知道为什么向导确定对象名称已经存在 - 我猜有些东西缓存在我无法追踪的地方.
I never found out why the wizard determined that the object name existed already - I'm guessing something was cached somewhere that I couldn't track down.
p>
最后,我在创建它时在接口名称的末尾附加了一个 2 以允许添加它.然后我用 IXxxInterfaceName 替换了所有出现的 IXxxInterfaceName2.此后一切正常.
In the end, I appended a 2 to the end of the interface name when creating it which allowed it to be added. Then I replaced all the occurrences of IXxxInterfaceName2 with IXxxInterfaceName. Everything worked after this.
如果我能找到这个问题的根本原因,我会更新答案.
If I ever track down the root cause of this problem, I'll update the answer.
这篇关于ATL 简单对象向导 - “对象 Xxx 已存在"错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:ATL 简单对象向导 - “对象 Xxx 已存在"错误
基础教程推荐
- 为什么 typeid.name() 使用 GCC 返回奇怪的字符以及如 2022-09-16
- CString 到 char* 2021-01-01
- 非静态 const 成员,不能使用默认赋值运算符 2022-10-09
- 初始化列表*参数*评估顺序 2021-01-01
- 如果我为无符号变量分配负值会发生什么? 2022-01-01
- 我应该对 C++ 中的成员变量和函数参数使用相同的名称吗? 2021-01-01
- GDB 显示调用堆栈上函数地址的当前编译二进制文 2022-09-05
- 为什么派生模板类不能访问基模板类的标识符? 2021-01-01
- 通过引用传递 C++ 迭代器有什么问题? 2022-01-01
- 为什么 RegOpenKeyEx() 在 Vista 64 位上返回错误代码 2021-01-01
