0

I wrote an XPCOM component and an extension that uses it. XPCOM loads arbitrary DLL for its purposes.

How can I include XPCOM and DLL into XPI package?

Dmitry Mukhin
  • 6,649
  • 3
  • 29
  • 31

2 Answers2

1

I was able to find absolute path to my DLL via IExtensionManager and IInstallLocation, then load it via LoadLibrary().

  1. put DLL near XPCOM in my.xpi/components/
  2. figure out the path to extension via IExtensionManager and IInstallLocation
  3. LoadLibrary()
  4. profit
Dmitry Mukhin
  • 6,649
  • 3
  • 29
  • 31
0

XPI is basically a zip file, which includes the DLL, among other things See https://developer.mozilla.org/En/Creating_XPI_Installer_Modules

Yarik
  • 1,172
  • 2
  • 9
  • 17
  • yes, but i can't find the way to load DLL from XPCOM. now i am struggling to get a path to extension directory to use in LoadLibrary call. – Dmitry Mukhin Feb 24 '09 at 17:25
  • What is your environment? Win/UNix/Mac, Firefox/Thunderbird? THe paths to extension directories depend on that. – Yarik Feb 25 '09 at 13:41
  • I figure with IExtensionManager and IInstallLocation, you can neglect environment differences. – Dmitry Mukhin Mar 11 '09 at 11:47