ActiveX and Windows Form

  • Thread starter Thread starter Hakùna kù
  • Start date Start date
H

Hakùna kù

Hello everybody,
i need to use an ActiveX in Windows Form application

So I have add it as a Reference :
Reference => Add => COM => MyActiveX file

I have instanced it , in a WinForm but no active x
control is shows in my Form :-(

So , i have try to added it in a control :
myForm.Controls.Add(myActivex);

But it isn't an Control and i can't add it ...

I haven't understand how I can do it .

I know that i can derive from AxHost with a .EXE utility :
but there are other way to do it ?

Hakù
 
What is the type of Activex? Is it OCX or DLL
If it is OCX try to add the control in your ToolBox

Sooraj P
Microsoft Community Star
 
If it is OCX try to add the control in your ToolBox.

It is an OCX , but now work fine .
The only problem that i see is If I run myForm.exe with
\\server\folder\file.exe
and it must load "myFile.dll" that contain the AxHost :

then the system show my an exception ... it can't found the DLL ...

but i'm sure that the file.exe and myfile.dll is in the same directory .

The Network path don't resolve the DLL reference ?

Hakù
 
It could also be that when the executable is run from a network share, it is
granted much less permissions.
But, on the other hand, this would rather throw a SecurityException.

So:

1) ensure you have the ActiveX control itself registered on the machine from
which you are starting the application.
2) I remember something like two interop DLLs are actually created when you
add a reference to an ActiveX control. If this is the case, ensure you have
both of them available on the network share.
3) Use the Fusion Log Viewer utility to investigate which paths are probed
for the DLL
 
1) ensure you have the ActiveX control itself registered on the machine
from
which you are starting the application.

is My Self computer : for testing :-)

So i have shared my folder in my Machine for testing :
so It is register .

2) I remember something like two interop DLLs are actually created when you
add a reference to an ActiveX control. If this is the case, ensure you have
both of them available on the network share.

Yes : is available , is my machine .
3) Use the Fusion Log Viewer utility to investigate which paths are probed
for the DLL

ok .

Haku
 
Back
Top