code for Firefox and compile it. It creates a /bin directory which is what you pass NS_InitEmbedding ().

thx Niky you're right, initialisation is ok now... may you give me some clues on how to load an URI ? nsIWebNavigation::LoadURI returns me a NS_ERROR_UNEXPECTED ...

thx Olivier.

        nsCOMPtr<nsIWebBrowser> theWebBrowser;
        nsCOMPtr<nsIWebNavigation> theWebNav; // nsIWebNavigation object

        theWebBrowser = do_CreateInstance(NS_WEBBROWSER_CONTRACTID, &rv);
        if (NS_FAILED(rv)) {
            printf("do_CreateInstance FAILED (rv = 0x%08x)\n", rv);
            // DROP THROUGH
        }
        else {
            printf("do_CreateInstance SUCCEEDED (rv = 0x%08x)\n", rv);
        }

        theWebNav = do_QueryInterface(theWebBrowser, &rv);
        if (NS_FAILED(rv)) {
            printf("do_QueryInterface FAILED (rv = 0x%08x)\n", rv);
            // DROP THROUGH
        }
        else {
            printf("do_QueryInterface SUCCEEDED (rv = 0x%08x)\n", rv);
        }

rv = theWebNav->LoadURI((const PRUnichar*)(argv[1]), nsIWebNavigation::LOAD_FLAGS_NONE, nsnull, nsnull, nsnull);
        if (NS_FAILED(rv)) {
            printf("LoadURI FAILED (rv = 0x%08x)\n", rv);
            // DROP THROUGH
        }
        else {
            printf("LoadURI SUCCEEDED (rv = 0x%08x)\n", rv);
        }
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding

Reply via email to