Bones wrote:
To me it seems very difficult to troubleshoot a XPCOM registration failure. That is, after carefully following all of the correct steps to register a new C++ XPCOM .so, an alert(Components.classes[myCID] ) displays "undefined". Also, the component shows up in the type library manifest (xpti.dat) but not in the component manifest (compreg.dat). Where should we start when trying to figure out what the problem is?
"Components" don't show up in xpti.dat, only interfaces...
7. Go to gecko-sdk/bin and execute: regxpcom /[firefox-install]/components
regxpcom should never be used in toolkit applications (Firefox/Tbird). It is a holdover from an older way of doing xpcom registration in the Mozilla suite.
Unfortunately, there aren't very good debugging mechanisms in place for release builds of the branches. The most common registration problems are that you didn't export NSGetModule properly, and that your component has DLL dependencies which aren't be resolved at load time. stace/ltrace/ldd may all help. It may also be useful to build a debug build of Firefox yourself and try loading the component into that: debug builds are much more verbose about loading errors.
On trunk, I have changed the component loading system so that load errors are reported to the JS console and NSPR logging is available for more detailed diagnosis. Not that that's likely to help you much until Firefox :-(
--BDS _______________________________________________ dev-tech-xpcom mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-xpcom
