Richard wrote:
So I finally had the NS_InitEmbedding working, however I had to do the
following :
rv = NS_InitEmbedding(binDir, nsnull);
f(NS_FAILED(rv))
{
rv = NS_InitEmbedding(binDir, nsnull);
if(NS_FAILED(rv))
{
return FALSE;
}
}
THe first call always seemed to fail, but the second one works,
This is because NS_InitEmbedding does reentrancy checks; you need to fix the
first failure.
However when I include that code in my project I get linker errors trying to
find NS_GetComponentRegistrar. Any ideas?
currentyly I'm linking in :
embed_base_s.lib
nspr4.lib
profdirserviceprovider_s.lib
xpcomglue.lib
plc4.lib
plds4.lib
You are linking xpcomglue.lib, but not defining XPCOM_GLUE. That will
definitely cause problems.
Also, since you are using the standalone glue, you will need to call
XPCOMGlueStartup() before using any XPCOM functions (they are loaded
dynamically). Finally, it makes little sense to link against the standalone
glue *and* against NSPR: if you're going to depend on mozilla libs, you
might as well use the dependent glue (link xpcomglue_s.lib and xpcom.lib,
don't define XPCOM_GLUE, and you don't need to call XPCOMGlueStartup()).
and have my preprocessor set to
XP_WIN32
XP_WIN
Please ensure that you're including xpcom-config.h, instead of specifying
only these defines.
--BDS
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding