1. 程式人生 > >Interop.xxx.dll和AxInterop.xxx.dll區別

Interop.xxx.dll和AxInterop.xxx.dll區別

在.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.