I face the same problem.
Please post the solution when you get it as I will.
Regards,
Philippe
On Friday 04 November 2005 10:52 am, Gautam Bhagra wrote:
> Hi all,
>
> I am unable to get my XPCOM component registered in Firefox 1.5 RC1
> I get the "Components.classes[classid] has no properties" error in Firefox
> browser, whenever i try to access my component. I have compiled my XPCOM
> code using gecko sdk 1.7
> Also, since CView does not work with Firefox 1.5, i am unable to see the
> components that are registered with Firefox 1.5
>
> Is there some other sdk that i am supposed to use to compile my components
> in order to use with Firefox 1.5?
>
> Also, is there some other extension that i can use with Firefox 1.5 in
> order to see the components registered there?
>
> Thanks in advance
> Gautam
>
>
> ---------------------------------
> Yahoo! FareChase - Search multiple travel sites in one click.
--
*************************************
Philippe C. Martin
SnakeCard, LLC
www.snakecard.com
*************************************
Firefox 1.5RC1 uses the 1.8 SDK, not the 1.7 one. I believe there's a
copy in
http://ftp.mozilla.org/pub/mozilla.org/mozilla/releases/mozilla1.8b1/
There does seem to be a working cview in the source tree, but I do not
know if anyone has a copy anywhere. (I'm building Firefox myself, which
lets me use it.) As a workaround, reading the generated compreg.dat in
your Firefox profile folder will also tell you what components are
registered (but not what interfaces each implements).
Hope this helps,
Mook (random bystander)
But components compiled with the 1.7 SDK are supposed to be compatible
with Firefox 1.5 too.
NS_IMPL_NSGETMODULE("MyModule", components)
_______________________________________________
Mozilla-xpcom mailing list
Mozill...@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-xpcom
What libraries are you linking to?
_______________________________________________
Mozilla-xpcom mailing list
Mozill...@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-xpcom
You also need to link to one of the glue variants, see
http://developer.mozilla.org/en/docs/XPCOM_Glue
"Gautam Bhagra" <gautam...@yahoo.com> wrote in message news:mailman.1131101526...@mozilla.org...
"Christian Biesinger" <cbies...@web.de> wrote in message
news:mailman.1131626257....@mozilla.org...
> 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
>
Martin
That probably means that the interface changed between the header file
you used and the firefox version you are running. That means that the
IID of the interface changed, so do_CreateInstance fails too.
You could compile against new headers, or get both versions (rename the
interface in one of them), and QI to both versions.