Dynamically loading unmanaged OCX in C #

I have ocx created in VC ++. If it is loaded statically, it works fine, but when I load it dynamically from the assembly, it gives an exception.

    public Assembly assembly;

    public Form1()
    {
        InitializeComponent();            
       assembly = Assembly.LoadFile(Application.StartupPath + "\\abc.ocx");

    }

he gives the following exception. The module is expected to contain an assembly manifest.

(Exception from HRESULT: 0x80131018)

+3
source share
2 answers

, , . , Aximp.exe .NET interop. Visual Studio . , axinterop.foo.dll -, AxHost, . interop.foo.dll, interop, COM- , .NET-.

, DLL . ", ".

Assembly.Load( "axinterop.foo.dll" ) interop.

, Assembly.CreateInstance() AxHost. , , , ildasm.exe axinterop.foo.dll. AxHost.

, . - , , , .

dynamic, , , , . , , , .


, , . , , OCX . Assembly.Load() .

+4

Assembly.LoadFile .Net, dll/exe/ocx.

ocx , ocx.

+1

All Articles