views:

544

answers:

1

My FireFox extension has an external dll dependency for functioning. So I include that dll inside my xpi and copy that dll to the right directory in first run. But it does not work for me because I found my own dll (written in XPCOM C++) expects to see that external dll during install. So every time I have to manually put the external dll in the right directory, but that is not convenient for a user.

Is there any way that I can combine copying external dll and installing xpi into one package and have an automatic install?

A: 

If the external DLL has only a few exports, don't link to it. Instead, call LoadLibrary and GetProcAddress.

If the external DLL has many exports but you only need functions, put off loading the DLL until you actually need it via the delay-load mechanism offered by the linker.

http://msdn.microsoft.com/en-us/library/151kt790(VS.80).aspx

If you need data exports from the external DLL, I'm not sure there is much hope here.

Integer Poet