On Jan 31, 6:13 am, [EMAIL PROTECTED] wrote:
> http://developer.mozilla.org/en/docs/Roll_your_own_browser_-_An_embed...
>
> However this web page gives the function
It's a wiki, if there's something wrong, feel free to either Talk: or
fix it.
> nsresult NS_InitEmbedding(const char *aPath);
>
> whereas mozilla/dist/sdk/include/nsEmbedAPI.h has
>
> extern "C" NS_HIDDEN NS_METHOD
> NS_InitEmbedding(nsILocalFile *aMozBinDirectory,
> nsIDirectoryServiceProvider *aAppFileLocProvider,
> nsStaticModuleInfo const *aStaticComponents =
> nsnull,
> PRUint32 aStaticComponentCount = 0);
>
> OK, no big deal since it says I can pass nsnull as the second
> parameter. Per the instructions in nsEmbedAPI.h, I use
> NS_NewLocalFile() to create the path:
If the instructions are buggy (always possible), please file a bug.
> nsILocalFile* path = nsnull ;
> nsresult path_result = NS_NewLocalFile(NS_LITERAL_STRING("."),
> PR_FALSE, &path) ;
> nsresult init_result = NS_InitEmbedding(path, nsnull) ;
You leak path.
> return 0 ;}
> % ./mytest
> path_result: c1f30001
> path: 0
> Googling for 0xc1f30001, I find that it means
> NS_ERROR_NOT_INITIALIZED. It appears that I need to create an
> nsILocalFile in order to call NS_InitEmbedding(), but in order to do
> so I need to have the embedding initialized!
>
> Maybe this is a simple problem? Any help would be appreciated.
if you look at how other embeddings work you'll see that you can call
something like NS_NewNativeLocalFile (use <http://mxr.mozilla.org/
seamonkey/ident?i=NS_InitEmbedding> and read the hits?)
http://mxr.mozilla.org/seamonkey/source/embedding/browser/gtk/src/EmbedPrivate.cpp#860
Is the example I chose to read.
> Also, if you've read this far already, perhaps you wouldn't mind
> telling me if you think it's feasible to embed an interactive Flash
> player (via the mozilla Flash plugin) inside an app for Mac OS X?
not sure what that means, but sure, it's possible :).
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding