Troubleshooting module loading - Mozilla

This is a discussion on Troubleshooting module loading - Mozilla ; I'm writing an extension with a XPCOM module written in C++. The trouble is the module doesn't appear to be loaded. When I try to load the module from Javascript using the contract id as in: var myif = Components.classes['mycontractid']. ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Troubleshooting module loading

  1. Troubleshooting module loading

    I'm writing an extension with a XPCOM module written in C++. The
    trouble is the module doesn't appear to be loaded.

    When I try to load the module from Javascript using the contract id as in:
    var myif = Components.classes['mycontractid'].
    createInstance(Components.interfaces.myInterface);
    and try to use myif, I get the error that myif has no properties.

    I installed the XPCOM Viewer extension, and sure enough, my contract id
    doesn't appear in the list of names.

    I looked in my extensions directory, and my extension's directory
    exists, and a libmyModule.so exists in the components subdirectory. It
    exports NSGetModule.

    Any ideas how to troubleshoot what I'm doing wrong? Thanks,
    --Juan

  2. Re: Troubleshooting module loading

    On Fri, May 2, 2008 at 3:03 PM, Juan Lang wrote:
    > Any ideas how to troubleshoot what I'm doing wrong? Thanks,


    Have you tried the ideas on
    http://developer.mozilla.org/en/docs...s_registration
    ? If not, they're a good start.

    Mike

  3. Re: Troubleshooting module loading

    (Reposting on newsgroup, sorry for the dup Mike)

    Mike Shaver wrote:
    > Have you tried the ideas on
    > http://developer.mozilla.org/en/docs...s_registration
    > ? If not, they're a good start.


    Thank you, that's very helpful.

    I now know that my module isn't getting loaded because it has unresolved
    symbols, in particular, nsUInt32Array::nsUInt32Array,
    nsUInt32Array::GetSize, and nsUInt32Array::~nsUInt32Array. I'm going
    bonkers trying to figure out how to resolve these, however.

    They're defined in libmsgbsutl_s.a. I try to add this to my Makefile in
    the same way others do, as in:
    ifndef MOZ_STATIC_MAIL_BUILD
    SHARED_LIBRARY_LIBS += $(DIST)/lib/$(LIB_PREFIX)msgbsutl_s.$(LIB_SUFFIX)
    endif

    But MOZ_STATIC_MAIL_BUILD appears to be defined in my autoconf.mk.
    Simply adding this unconditionally didn't solve the problem for me, either.

    Any other suggestions? Thanks very much,
    --Juan

  4. Re: Troubleshooting module loading

    Juan Lang wrote:

    > I now know that my module isn't getting loaded because it has
    > unresolved symbols, in particular, nsUInt32Array::nsUInt32Array,
    > nsUInt32Array::GetSize, and nsUInt32Array::~nsUInt32Array. I'm going
    > bonkers trying to figure out how to resolve these, however.


    Use some other sort of array. Thunderbird 3.0a1 now uses
    nsTArray or nsAutoTArray instead.

    --
    Warning: May contain traces of nuts.

+ Reply to Thread