如何防止VisualStudio将名称空间放在TypeLib协类名称的前面? [英] How do I prevent VisualStudio from prepending namespace to TypeLib coclass name?

查看:52
本文介绍了如何防止VisualStudio将名称空间放在TypeLib协类名称的前面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个工作到现在的COM可调用包装器.

I have a COM Callable Wrapper that has worked up until now.

现在,当我尝试编译依赖它的VB6应用程序时,出现未定义用户定义类型"错误.发生了变化的事情包括将COM Callable Wrapper从.Net Framework 2移到了4,并且我现在使用的是VS2013,而不是VS2010.对代码进行了一些更改,但我认为没有任何变化.

Now I get a "user defined type not defined" error when I try to compile my VB6 application which depends on it. Things that have changed include the COM Callable Wrapper being moved from .Net Framework 2 to 4 and I am using VS2013 now instead of VS2010. There are some changes to code but none which I can see as being responsible.

当我在oleview.exe中查看生成的typelib并将其与以前的版本进行比较时,我看到名称空间(带有下划线)已添加到我的两个协类的前面,因此我现在有了 coclass CompanyName_Compatibility_Field code>在我之前只是 coclass字段的地方,我认为这是导致问题的原因.

When I look at the generated typelib in oleview.exe and compare it to the previous version I see the the namespace (with underscores) has been prepended to two of my coclasses so that I now have coclass CompanyName_Compatibility_Field where before I had just coclass Field which I assume is the cause of my problems.

我一直都有对经典ADODB主互操作程序集的引用,但现在我在生成的typelib中有一个 importlib("msado15.dll"); 语句,以前我没有,现在是typelib包括许多ADODB枚举类型的枚举定义,以前是没有的.

I have always had a reference to classic ADODB primary interop assembly but now i have an importlib("msado15.dll"); statement in the generated typelib where previously I did not and the typelib now includes enum definitions for a number of ADODB enum types where previously it did not.

ADODB是现在将名称空间添加到我的 Field 对象之前的原因,并且有什么方法可以防止这种情况并从typelib中排除ADODB吗?

Is ADODB the reason why the namespace is now being prepended to my Field object and is there a way I can prevent this and exclude ADODB stuff from the typelib?

推荐答案

我更改了ADODB参考和Active Reports参考(还具有 Field 对象),现在我的VB6应用程序就会编译.我承认我没有意识到这个财产.从框架2迁移到4后,当我重新添加一些引用时,它肯定已经更改.

I changed the Embed Interop Types property for the ADODB reference and an Active Reports reference (which also has a Field object) and now my VB6 application compiles. I confess I was unaware of this property. It must have changed when I re-added some references after moving from framework 2 to 4.

这篇关于如何防止VisualStudio将名称空间放在TypeLib协类名称的前面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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