ActiveX Control can not find native dll

ActiveX Control can not find native dll

Post by Jonas Gust » Tue, 24 Apr 2007 17:00:35

Hi Everyone!

I'm developing an ActiveX control that does the following:
1. Download an application (several files) over HTTP - this works fine
2. Run the application through an entrypoint in a downloaded DLL -
this I can't get to work

The call to the DLL is declared in the regular way
Private Declare Sub MyNativeCall Lib "MyLibrary.dll" (...)

However, when I make the MyNativeCall call, I end up with a "Runtime
error 48: File Not Found: MyLibrary.dll"

If I include the full path to the DLL in the declaration, like:
Private Declare Sub MyNativeCall Lib "C:\MyPath\MyLibrary.dll" (...)
The call works. This is not an option though, because I don't know
that path at compile time.

I tried placing the DLL in the windows\system32 directory - File not
I tried including the DLL in the CAB for the activeX - File not found.

I'd really prefer if there was a way to be able to download and place
the DLL among the other downloaded files. The second best thing would
be to deploy it with the ActiveX. Why can't the control find it even
though I put them in the same package (using the package and
deployment wizard)

Help and tips are greatly appreciated!
/Jonas Gustavsson