ATL简单对象向导-“对象Xxx已经存在".错误 [英] ATL simple object wizard - "Object Xxx already exists" error

查看:64
本文介绍了ATL简单对象向导-“对象Xxx已经存在".错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用Visual Studio 2005中的 ATL简单对象向导在我的DLL中创建一个新的COM对象.

我输入对象的简称,所有其他字段都将导出.

但是,当我在向导中单击 Next 时,会出现以下错误消息:

 对象'IXxxInterfaceName'已经存在 

我已经在整个解决方案中搜索了所有对IXxxInterfaceName的引用,但是找不到在任何地方定义它.

向导如何确定它已经存在?

解决方案

我从来没有发现为什么向导确定对象名称已经存在-我猜是某些内容被缓存在无法跟踪的地方.

最后,在创建接口名称时,我在接口名称的末尾附加了2,以允许添加接口名称.然后,我将所有出现的IXxxInterfaceName2替换为IXxxInterfaceName.此后一切正常.

如果我找到了此问题的根本原因,我将更新答案.

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

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.

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已经存在".错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆