Any news on this issue ?
I can get the componenent registered in 1.5 by using the latest gecko-sdk,
but now calls to do_createinstance that worked in earlier versions fail,
and the nsIDOMXULCommandDispatcher-trick for getting access to the DOM of a
html-page does not work anymore.
Martin
----- Original Message -----
From: "Thomas Lee" <[EMAIL PROTECTED]>
Newsgroups: netscape.public.mozilla.xpcom
To: <[email protected]>
Sent: Thursday, November 10, 2005 4:08 PM
Subject: Re: XPCOM component not getting registered in Firefox 1.5
Comments below.
"Christian Biesinger" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Thomas Lee wrote:
I went through all of the same issues that most everybody here has
talked about with FF .5 registration. My scenario was that I
developed a toolbar for FF 1.0.X and it has come time to upgrade this
to work with FF 1.5. It was my understanding that the Gecko 1.7 SDK
would be sufficient to use with FF 1.5.
That is indeed the theory, as long as you are using only frozen
functions.
Not the case however. When I
tried to instantiated my C++ component I received a
NS_ERROR_XPC_CI_RETURNED_FAILURE error.
Well, there are two possibilities that I can currently think of for
this...
o) You have an Init() method + NS_GENERIC_FACTORY_CONSTRUCTOR_INIT, and
that Init method returns a failure code
o) The IID of the interface that JS is asking for has changed
o) (maybe) compreg.dat is out of date
It might be the case that you are linking to unfrozen symbols in xpcom
that changed, although I'd think that that would give a different error.
Well that is what I thought originally with the 1.7 SDK. That is why I
created an empty interface. In other words I deleted all my code and just
had the empty methods returning NS_OK - just to see if I could instantiate
my interface.
The result is that it failed with
Error: [Exception... "Component returned failure code: 0x80570015
(NS_ERROR_XPC_CI_RETURNED_FAILURE) [nsIJSCID.createInstance]" nsresult:
"0x80570015 (NS_ERROR_XPC_CI_RETURNED_FAILURE)" location: "JS frame ::
chrome://mycomponent/content/mycomponent.js :: onInit :: line 67" data:
no]
Source File: chrome://mycomponent/content/mycomponent.js
Line: 67
BTW - this fails if I use getService() or createInstance() from my script.
If I create a debug version and set break points in my code the last item
that is called from FF 1.5 is NS_IMPL_NSGETMODULE. I never actually hit
the constructor of my interface. So the failure is definitely something to
do with NS_IMPL_NSGETMODULE I believe.
I even went so far as to
create an empty shell of a component and still received the error. So
after mucking around for a day or so I decided to solicit the news
group where I learned that in fact we had to use the 1.8 Gecko SDK
for FF 1.5.
You should compile with the SDK of the oldest version that you want to
run with. I do believe that people succeeded in doing this :)
Compiling is not really the issue with 1.7. The issue is purely runtime
with FF 1.5. I went back this morning and revisited the 1.7 SDK with
MOZILLA_STRICT_API defined and I do still get the same error
(NS_ERROR_XPC_CI_RETURNED_FAILURE) when FF 1.5 tries to load my XPCOM
component. I also verified that the last ietsm that is called within my
DLL is NS_IMPL_NSGETMODULE.
No problem I thought - however I ran into several issues.
One issue was that I no longer could use nsEmbedString class as it
would no longer compile. After research I discovered that I should
use nsString - however to use this class I had to define
MOZILLA_STRICT_API.
Yeah, if you want cross-version compatibility you should define
MOZILLA_STRICT_API. (Not needed for a Gecko 1.8 SDK, though)
Odd that nsEmbedString doesn't work for you... it certainly should (it's
a typedef for nsString, see nsStringAPI.h / nsEmbedString.h)
These are the errors I get when I include nsEmbedString.h with 1.8. Same
code compiles with 1.7.
c:\gecko-sdk\include\nsembedstring.h(48) : error C2146: syntax error :
missing ';' before identifier 'nsEmbedString'
c:\gecko-sdk\include\nsembedstring.h(48) : fatal error C1004: unexpected
end of file found
So I said what the heck - so I defined out of
spite. So now everything compiles except for one tiny problem - I can
no longer use NS_GetServiceManager because it is not included when I
define MOZILLA_STRICT_API.
Did you try #include "nsXPCOM.h"?
I included this and it did compile which brought me to the next issue
which is a runtime issue. I no longer can complete the following without a
NS_NOINTERFACE error.
rv = spServiceManager->GetServiceByContractID(
"@mozilla.org/appshell/appShellService;1",
NS_GET_IID(nsIAppShellService),
getter_AddRefs(spAppShell));
do_GetService() does not work either with 1.8.
You might also want to look at
http://developer.mozilla.org/en/docs/XPCOM_Glue#Compiling_or_linking_against_XPCOM_headers
if you haven't already.
I think this is my home page for my browser in the last couple days. :-)
-biesi
_______________________________________________
Mozilla-xpcom mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-xpcom
_______________________________________________
Mozilla-xpcom mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-xpcom