Hi Doug,
> Search your system for compreg.dat. We need to be
> sure that your component was added into the
> registry.
I've looked for this file and I do not have it. I must say that my
system is a solaris 2.6 and not Windows. However, I could find
$MOZILLA_FIVE_HOME/component.reg
$MOZILLA_FIVE_HOME/components/xpti.dat
component.reg seems to be a binary data file and I can see strings
referring to my component "libconfigsvc.so" in that file.
xpti.dat is a text file and has the following contents:
---- start of xpti.dat ------
# Generated file. ** DO NOT EDIT! **
[Header,2]
0,Version,2,0
1,AppDir,/tmp/vocal-basic/code/src
[Directories,3]
0,/tmp/vocal-basic/code/src/components
1,/homes/syseng/prodeng/iad/default/ramin/.mozilla/plugins
2,/tmp/vocal-basic/code/src/plugins
[Files,0]
[ArchiveItems,0]
[Interfaces,0]
---- end of xpti.dat ------
I'm using XPCOM 1.0.2 (and am unable to upgrade to a newer version so long
I don't have a decent understanding of the current code).
This is the simple program I'm testing with (I commented out the registration
steps as Stephen had instructed me and still can see that the component gets
registered/loaded):
int main(void) {
nsresult rv = NS_OK;
putenv("NSPR_LOG_MODULES=all:5");
putenv("NSPR_LOG_FILE=xpcom.log");
// Initialize XPCOM
rv = NS_InitXPCOM2(nsnull, nsnull, nsnull);
NS_ENSURE_SUCCESS(rv, rv);
if (NS_FAILED(rv)) {
printf("ERROR: XPCOM intialization error [%x].\n", rv);
return -1;
}
/*
// register all components in our default component directory
nsCOMPtr<nsIComponentRegistrar> registrar;
rv = NS_GetComponentRegistrar(getter_AddRefs(registrar));
if(NS_FAILED(rv)) {
NS_ShutdownXPCOM(nsnull);
return rv;
}
rv = registrar->AutoRegister(nsnull);
if(NS_FAILED(rv)) {
NS_ShutdownXPCOM(nsnull);
return rv;
}
NS_ENSURE_SUCCESS(rv, rv);
*/
// Create an instance of our component
static NS_DEFINE_CID(kConfigServiceCID, XP_CONFIGSERVICE_CID);
nsCOMPtr<xpIConfigService> pConfigSvc = do_GetService(kConfigServiceCID, &rv);
if (NS_FAILED(rv))
{
printf("XP Config Service unavailable. Cannot continue [%x].\n", rv);
NS_ShutdownXPCOM(nsnull);
return rv;
}
...
...
}
After the run of the application, the contents of NSPR_LOG_FILE=xpcom.log is:
1[26ce0]: Loaded library a.out (init)
1[26ce0]: nsNativeComponentLoader: loading
"/tmp/vocal-basic/code/src/components/solaris/debug/libconfigsvc.so"
1[26ce0]: Loaded library
/tmp/vocal-basic/code/src/components/solaris/debug/libconfigsvc.so (load lib)
1[26ce0]: nsNativeComponentLoader: Factory creation succeeded for
rel:solaris/debug/libconfigsvc.so
1[26ce0]: nsNativeComponentLoader: Unloading....
1[26ce0]: nsNativeComponentLoader: nsIModule::CanUnload() returned error for
/tmp/vocal-basic/code/src/components/solaris/debug/libcon
figsvc.so.
Thanks for the help.
Ramin
>
> Also, it would help to see the code that you wrote
> that registers you component.
>
> How recent of a copy of XPCOM are you using?
>
> Doug Turner
> [EMAIL PROTECTED]
_______________________________________________
Mozilla-xpcom mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-xpcom