如何编写COM组件......? [英] How to write a COM components ...?

查看:99
本文介绍了如何编写COM组件......?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在VB.NET帮助文件演练:创建COM对象

with Visual Basic .NET中,它说:


"注意使用Visual生成的COM对象
Studio .NET不能被其他Visual Studio .NET

应用程序使用。尝试添加对此类COM

对象的引用会引发错误。


我的问题是:


如何编写一个COM对象,也可以用于
Visual Studio .NET应用程序?

In VB.NET help file "Walkthrough: Creating COM Objects
with Visual Basic .NET", It said:

"Note The COM objects you generate with Visual
Studio .NET cannot be used by other Visual Studio .NET
applications. Attempts to add references to such COM
objects raise an error."

My question is:

How to write a COM objects which can also be used by
Visual Studio .NET application?

推荐答案

> 注意使用Visual
> "Note The COM objects you generate with Visual
Studio .NET生成的COM对象不能被其他Visual Studio .NET
应用程序使用。尝试添加对此类COM对象的引用会引发错误。

我的问题是:

如何编写COM对象,也可以使用
Visual Studio .NET应用程序?
Studio .NET cannot be used by other Visual Studio .NET
applications. Attempts to add references to such COM
objects raise an error."

My question is:

How to write a COM objects which can also be used by
Visual Studio .NET application?




您注意到上面的注释从未说明您无法直接引用该对象

,您只是可以将它作为COM对象引用。所以基本上这意味着

当你创建一个.NET COM对象时,你得到一个.TLB文件和一个.DLL或

..EXE。上面的注释只是说你不能在

..NET中使用_COM_对象,但普通程序集(.DLL)应该没问题。


这就是我理解它的方式,我可能错了,但这是否意味着

感觉?


~

Jeremy



You notice that the Note above never says you cant reference the object
directly, you just can reference it as a COM object. So basically this mean
that when you create a .NET COM object, you get a .TLB file and a .DLL or
..EXE. The note above is just saying that you can''t use the _COM_ object in
..NET, but the plain assembly (.DLL) should be fine.

This is the way I understood it, and I may be wrong, but does that make
sense?

~
Jeremy


你好,


" kathy" < KA *** @ nospam.com> schrieb:
Hello,

"kathy" <ka***@nospam.com> schrieb:
在VB.NET帮助文件演练:使用Visual Basic .NET创建COM对象中,它说:

"注意COM使用Visual
Studio .NET生成的对象不能被其他Visual Studio .NET
应用程序使用。尝试添加对此类COM对象的引用会引发错误。

我的问题是:

如何编写COM对象,也可以使用
Visual Studio .NET应用程序?
In VB.NET help file "Walkthrough: Creating COM Objects
with Visual Basic .NET", It said:

"Note The COM objects you generate with Visual
Studio .NET cannot be used by other Visual Studio .NET
applications. Attempts to add references to such COM
objects raise an error."

My question is:

How to write a COM objects which can also be used by
Visual Studio .NET application?


http://msdn.microsoft.com/library/en...sAttribute.asp


HTH,

Herfried K. Wagner

-

MVP·VB Classic,VB .NET
http://www.mvps.org/dotnet


" ;凯西" < KA *** @ nospam.com> schrieb
"kathy" <ka***@nospam.com> schrieb
在VB.NET帮助文件演练:使用Visual Basic .NET创建COM对象中,它说:

"注意COM对象使用Visual生成的.NET .NET不能被其他Visual Studio .NET应用程序使用。尝试添加对此类COM对象的引用会引发错误。

我的问题是:

如何编写COM对象,也可以使用
Visual Studio .NET应用程序?
In VB.NET help file "Walkthrough: Creating COM Objects
with Visual Basic .NET", It said:

"Note The COM objects you generate with Visual
Studio .NET cannot be used by other Visual Studio .NET
applications. Attempts to add references to such COM
objects raise an error."

My question is:

How to write a COM objects which can also be used by
Visual Studio .NET application?




"注意使用Visual生成的COM对象
Studio .NET不能使用通过其他Visual Studio .NET

应用程序。尝试添加对这样的COM

对象的引用会引发错误。

也许你可以在VB6中为.NET COM组件编写一个包装器组件

并在其他.NET项目中使用它...不是一个很好的建议,我知道了.b $ b。希望是更好的一个:你真的需要另一个.NET应用程序中的.NET-COM组件吗?为什么不直接使用托管.NET组件

,而不是通过它的COM包装器?

-

Armin



"Note The COM objects you generate with Visual
Studio .NET cannot be used by other Visual Studio .NET
applications. Attempts to add references to such COM
objects raise an error."
Maybe you could write a wrapper component in VB6 for your .NET COM component
and use it in the other .NET project... not really a good suggestion, I
know. Hopefully a better one: Do you really need a .NET-COM component in
another .NET application? Why don''t you use the managed .NET component
directly, not via it''s COM wrapper?
--
Armin


这篇关于如何编写COM组件......?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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