简体   繁体   English

AxInterop 和 Interop 有什么区别?

[英]What is the difference between AxInterop and Interop?

I've added an .ocx to the toolbox in VS.我在 VS 的工具箱中添加了一个 .ocx。 Two .dll's were created: Interop.NNN.dll, AxInterop.NNN.dll.创建了两个 .dll:Interop.NNN.dll、AxInterop.NNN.dll。

What is each one?每一个是什么? Are they both required?两者都需要吗?

Interop.xxx.dll and AxInterop.xxx.dll are runtime callable wrappers (RCW) for a referenced COM and an ActiveX dll respectively. Interop.xxx.dll 和 AxInterop.xxx.dll 分别是引用的 COM 和 ActiveX dll 的运行时可调用包装器 (RCW)。

interop.xxx.dll is purely an automation (a COM dll) wrapper, enabling you to manipulate the object within the namespace of your application. interop.xxx.dll 纯粹是一个自动化(COM dll)包装器,使您能够操作应用程序命名空间内的对象。 AxInterop.xxx.dll is a control wrapper for a ActiveX control, which can be dragged onto the form. AxInterop.xxx.dll 是 ActiveX 控件的控件包装器,可以将其拖到窗体上。

The AxFoo.dll assembly contains an automatically generated class that's derived from the System.Windows.Forms.AxHost control. AxFoo.dll 程序集包含一个从 System.Windows.Forms.AxHost 控件派生的自动生成的类。 It is pretty simple, it has methods, properties and events, the same ones you have available in the .ocx, that simply call the Foo.dll interop library.它非常简单,它具有方法、属性和事件,与您在 .ocx 中可用的相同,只需调用 Foo.dll 互操作库。

So, yes, you definitely need to deploy both assemblies.所以,是的,您肯定需要部署这两个程序集。

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

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