The first argument to NS_InitEmbedding is the path to the Mozilla bin
directory. If you pass nsnull in this arg it assumes the current
directory is the bin directory. If it isn't then you may find your app
won't work properly.
Therefore either copy your app to the Mozilla (or embedding) bin dir and
run from there, or supply the bin dir, e.g.
nsCOMPtr<nsILocalFile> binDir;
NS_NewLocalFile("c:\\mozilla\\bin", TRUE, getter_AddRefs(binDir));
NS_InitEmbedding(binDir, provider);
Adam
Paul Rouleau wrote:
>Hi,
>
>I'm in the early stages of embedding gecko in my own MFC test
>application.
>
>So far, I am only calling NS_InitEmbedding( nsnull, provider ); My
>provider class is currently identical to winEmbedFileLocProvider.
>
>I'm getting a curious failure inside NS_InitEmbedding. Internally this
>function calls:
>
>nsCOMPtr<nsIObserver> mStartupNotifier =
>do_CreateInstance(NS_APPSTARTUPNOTIFIER_CONTRACTID,
> &rv);
>if(NS_FAILED(rv))
> return rv;
>
>
>When I test the value of rv, it is not 0.
>
>Digging deeper, it appears that
>nsComponentManagerImpl::CreateInstanceByContractID is failing in a call
>to FindFactory. The error code from FindFactory is
>NS_ERROR_FACTORY_NOT_REGISTERED.
>
>
>I've looked through the source code for mfcEmbed and connot figure out
>how the "factory" gets registered. Am I going blind?
>
>
>I could sure use some help here.
>
>Thanks,
> Paul
>
>
>