在.Net中引用一个com组件的dll的时候,会生成一个Interop开头和AxInterop开头的的dll文件,这两个文件是怎么回事呢,有什么差别?
stackover上的解释如下:
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.
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.
参考资料:https://stackoverflow.com/questions/2287839/what-is-the-difference-between-axinterop-and-interop
本文解释了在.NET中使用COM组件时生成的Interop.xxx.dll和AxInterop.xxx.dll的区别。Interop.xxx.dll为纯COM库封装,允许在应用程序命名空间内操作对象;而AxInterop.xxx.dll则是ActiveX控件的封装,可以直接拖放到窗体上使用。
2755

被折叠的 条评论
为什么被折叠?



