4

Previously, I created XPCOM dll for the mozilla version 3.6 and XulRunner version of 1.9.2.

Now I try to update that xpcom dll for the mozilla recent versions namely 4 and above.

So I downloaded Xul Runner above version but I couldn't find nsIGenericFactory.h.

How to work my xpcom dll for the mozilla 4 and above versions.

Actually I used the following sample to develop XPCOM DLL.

http://www.iosart.com/firefox/xpcom/

Thanks..

karthik
  • 17,453
  • 70
  • 78
  • 122

1 Answers1

6

Since Mozilla 4.0 is using Gecko 2.0 this applys to your situation:
Quoting the XPCOM changes in Gecko 2.0:

Note that nsIGenericFactory.h has been removed.
References to nsIGenericFactory.h should be replaced with mozilla/ModuleUtils.h

After doing so, you would have to recompile all XPCOM components following the instructions from https://developer.mozilla.org/en/XPCOM/XPCOM_changes_in_Gecko_2.0

There is a topic about this problem in the mozilla forum too.


The headerfile is provided on this site: nsIGenericFactory.h

markusschmitz
  • 676
  • 5
  • 18
  • @ Fuzzy: previously, I compile this link http://www.iosart.com/firefox/xpcom/ with the help of gecko-sdk-1.9. Now I migrate to Gecko-sdk-2 or above. I changed the header file nsIgenericFactory.h into mozilla/ModuleUtils.h but the application is not compiling properly.How to run this sample with the help of new gecko-sdk-2 or above? – karthik Dec 26 '11 at 02:42
  • @ Fuzzy: for time being, I accepted your answer. Please try the above the link and give some suggestions. – karthik Dec 26 '11 at 02:43
  • @karthik: Did you try out the suggestions posted as comments on http://www.iosart.com/firefox/xpcom/? What does "not compiling properly" mean in your case? Errors? Referring to [this topic in the forums](https://forums.mozilla.org/addons/viewtopic.php?p=8900&sid=5ad316dc442eed775ef208b8cc56888f): `The only changes that you need to do is to declare it in chrome.manifest and recompile it for the 2.0 SDK` – markusschmitz Dec 26 '11 at 10:47
  • Fuzzy, I copied xpt file and put it under components folder and referred it from chrome.manifest. Still i am getting Link error like the following: xpcomglue_s.lib(GenericFactory.obj) : error LNK2001: unresolved external symbol __imp__moz_xmalloc Could you please help us What I need to do to resolve those link errors – Prabhu Jan 03 '12 at 10:30
  • [This link](http://web.archiveorange.com/archive/v/zOxEyIVzkcnAm06VMF9A) might help you. Since I'm not able to try this right now, I can only recommend the first results on a google search with your error. Sorry 'bout that! – markusschmitz Jan 03 '12 at 22:38