简体   繁体   English

如何使用COM组件

[英]How to use com components

i hav created a COM component using vs2005 . 我已经使用vs2005创建了一个COM组件。

Now let me know can i use the dll which i have create on vs2005(which uses f/w 2.0) in vs2003(which uses f/w 1.1)?? 现在,让我知道我可以使用在vs2003(使用f / w 1.1)中vs2005(使用f / w 2.0)上创建的dll吗?

I assume your real question is wether or not you can mix .NET versions in a single app as long as they use COM to interact. 我认为您真正的问题是,是否可以在单个应用程序中混合.NET版本,只要它们使用COM进行交互即可。

I believe the answer is "no". 我相信答案是“否”。 An AppDomain can only have one .NET runtime loaded. 一个AppDomain只能加载一个.NET运行时。 Multiple runtimes is a feature of .NET 4. 多个运行时是.NET 4的功能。

In .NET projects add a reference into the "references" branch of the solution and a using directive into each file you want to use that component. 在.NET项目中,将引用添加到解决方案的“引用”分支中,并将using伪指令添加到要使用该组件的每个文件中。 In C++ projects use import directive. 在C ++项目中,请使用import指令。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM