AxInterop 和 Interop 有什么区别?
我已将 .ocx 添加到 VS 的工具箱中。 创建了两个 .dll:Interop.NNN.dll、AxInterop.NNN.dll。
每一个是什么?两者都需要吗?
I've added an .ocx to the toolbox in VS.
Two .dll's were created: Interop.NNN.dll, AxInterop.NNN.dll.
What is each one? Are they both required?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Interop.xxx.dll 和 AxInterop.xxx.dll 分别是引用的 COM 和 ActiveX dll 的运行时可调用包装器 (RCW)。
interop.xxx.dll 纯粹是一个自动化(COM dll)包装器,使您能够在应用程序的命名空间内操作对象。 AxInterop.xxx.dll 是 ActiveX 控件的控件包装器,可以将其拖到窗体上。
Interop.xxx.dll and AxInterop.xxx.dll are runtime callable wrappers (RCW) for a referenced COM and an ActiveX dll respectively.
interop.xxx.dll is purely an automation (a COM dll) wrapper, enabling you to manipulate the object within the namespace of your application. AxInterop.xxx.dll is a control wrapper for a ActiveX control, which can be dragged onto the form.
AxFoo.dll 程序集包含一个从 System.Windows.Forms.AxHost 控件派生的自动生成的类。它非常简单,它具有方法、属性和事件,与 .ocx 中提供的相同,只需调用 Foo.dll 互操作库即可。
所以,是的,您肯定需要部署这两个程序集。
The AxFoo.dll assembly contains an automatically generated class that's derived from the System.Windows.Forms.AxHost control. 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.
So, yes, you definitely need to deploy both assemblies.