Re: XRE_InitEmbedding Fails.
On 25 nov, 15:21, Benjamin Smedberg wrote: > On 11/25/09 4:32 AM, Blaine Monkey wrote: > > > executables, I think this is the correct way, in't it? I saw the code > > of other examples and is the same. I don't know what can be the > > problem. Any idea? > > No, you'll need to actually debug the problem. > > --BDS I saw where is the problem, but now I've other problem. I downloaded xulrunner1.9.1.4 and installed it following the instructions, but Fedora installed an older version of xulrunner (1.0.15) in other path (/usr/lib/xulrunner-1.9). I change the path in the code and now the embedded browser appears. Thank you very much. ___ dev-embedding mailing list [email protected] https://lists.mozilla.org/listinfo/dev-embedding
Re: XRE_InitEmbedding Fails.
On 11/25/09 4:32 AM, Blaine Monkey wrote: > executables, I think this is the correct way, in't it? I saw the code > of other examples and is the same. I don't know what can be the > problem. Any idea? No, you'll need to actually debug the problem. --BDS ___ dev-embedding mailing list [email protected] https://lists.mozilla.org/listinfo/dev-embedding
Re: XRE_InitEmbedding Fails.
On 24 nov, 15:58, Benjamin Smedberg wrote: > On 11/24/09 9:41 AM, Blaine Monkey wrote: > > > I've a xulrunner C++ embedding example, it compiles and generates the > > executable, but when I run it, the XRE_InitEmbedding fails. I've xulrunner > > installed in /opt/xulrunner-1.9.1.4 > > > What am I doing wrong? > > The code doesn't look bad offhand. I was a bit suspicious of passing null > for the second parameter of XRE_InitEmbedding, but the code appears to deal > with that: > > http://mxr.mozilla.org/mozilla-central/source/toolkit/xre/nsEmbedFunc... > > I think your best bet is probably to step through and figure out why it's > not working. > > --BDS Sorry but I don't know what is the problem. As you say, if the second argument is null it takes the first argument (where libxull library was found). The application must be started with xulrunner command like a xulrunner desktop application? I run it like all linux executables, I think this is the correct way, in't it? I saw the code of other examples and is the same. I don't know what can be the problem. Any idea? ___ dev-embedding mailing list [email protected] https://lists.mozilla.org/listinfo/dev-embedding
Re: XRE_InitEmbedding Fails.
On 11/24/09 9:41 AM, Blaine Monkey wrote: > I've a xulrunner C++ embedding example, it compiles and generates the > executable, but when I run it, the XRE_InitEmbedding fails. I've xulrunner > installed in /opt/xulrunner-1.9.1.4 > > What am I doing wrong? The code doesn't look bad offhand. I was a bit suspicious of passing null for the second parameter of XRE_InitEmbedding, but the code appears to deal with that: http://mxr.mozilla.org/mozilla-central/source/toolkit/xre/nsEmbedFunctions.cpp#97 I think your best bet is probably to step through and figure out why it's not working. --BDS ___ dev-embedding mailing list [email protected] https://lists.mozilla.org/listinfo/dev-embedding
Re: XRE_InitEmbedding Fails to return
Problem resolved... My DLL is for an outlook addin and the way it works is the main App class has a callback function that outlook calls that returns a pointer to the addin class. What was happening is my DLL instantiated the base app class and in the class constructor I was trying to init the Gecko Library.. The problem was that the system was still inside of a loadlibrary or some other critical function. Gecko was apparently waiting for some resources to be released or unlocked or something along those lines causing the process to hang. I resolved it by moving the init functions to a function that gets called after the system initializes the DLL, makes the addin class.. I moved it to the callback function so that the system can load the dll properly. Thanks to Keisial for getting me thinking in the right direction.. Damon ___ dev-embedding mailing list [email protected] https://lists.mozilla.org/listinfo/dev-embedding
Re: XRE_InitEmbedding fails
You need to pass in the directory to your XULRunner file structure,
and to your Application's directory so that chrome can be loaded
properly.
Example:
// The greBaseDir and appDir varibles are wchar_t pointers, in Windows
these are unsigned shorts and work with the mozilla PRUnichar type.
If you are not using an OS that uses unsigned short to represent
wchar_t, then you should use the appropriate mozilla string conversion
routines to go from your native OS strings to PRUnichar before use.
Note, unix varients all use unsigned int for wchar_t as far as I'm
aware of (FreeBSD, Linux, OS X).
wchar_t *greBaseDir = "C:\Program Files\XULRunner"; // This is where
you will find the xul.dll, chrome subdir and the rest of the
components that are included in the XULRunner distribution
wchar_t *appDir = "C:\Program Files\MyApp"; // This is where you will
find the files specific to your application, such as your chrome
directory, your components dir and so forth. This can be the same as
greBaseDir if you are including the GRE with your application and not
using a system wide XULRunner. It is recommended however that you use
the system wide XULRunner if at all possible so your app gets updates
when XULRunner is updated on the system.
nsCOMPtr xulDir;
result = NS_NewLocalFile(nsString(greBaseDir), PR_TRUE,
getter_AddRefs(xulDir));
if(NS_FAILED(result)) {
Gecko_SetLastError(0x1002);
return(FALSE);
};
nsCOMPtr appDir;
result = NS_NewLocalFile(nsString(appBaseDir), PR_TRUE,
getter_AddRefs(appDir));
if(NS_FAILED(result)) {
Gecko_SetLastError(0x1003);
return(FALSE);
};
result = XRE_InitEmbedding(xulDir, appDir, nsnull, nsnull, 0);
if(NS_FAILED(result)) {
Gecko_SetLastError(0x1004);
return(FALSE);
};
On Apr 29, 12:46 am, dNafigator <[EMAIL PROTECTED]> wrote:
> #define XP_WIN 1
> #define XPCOM_GLUE 1
>
> #include
> #include
>
> #include "xpcom-config.h"
> #include "nsCOMPtr.h"
> #include "nsILocalFile.h"
> #include "nsStringAPI.h"
> #include "xulapp/nsXULAppAPI.h"
> #include "nsXPCOMGlue.h"
> #include "xulapp/nsXULAppAPI.h"
> #include "nsEmbedCID.h"
> #include "nsComponentManagerUtils.h"
>
> XRE_InitEmbeddingType XRE_InitEmbedding;
> XRE_TermEmbeddingType XRE_TermEmbedding;
>
> #pragma comment ( lib, "xpcomglue.lib" )
>
> int APIENTRY WinMain ( HINSTANCE hInstance, HINSTANCE hPrevInstance,
> LPSTR lpCmdLine, int nCmdShow )
> {
> nsDynamicFunctionLoad nsFuncs[] = {
> {"XRE_InitEmbedding", (NSFuncPtr*)&XRE_InitEmbedding},
> {"XRE_TermEmbedding", (NSFuncPtr*)&XRE_TermEmbedding},
> {0, 0}
> };
>
> TCHAR xpcomPath[_MAX_PATH] = TEXT("./xpcom.dll");
> rv = XPCOMGlueStartup ( xpcomPath );
> rv = XPCOMGlueLoadXULFunctions ( nsFuncs );
> rv = XRE_InitEmbedding ( 0, 0, 0, 0, 0 );
>
>
> }
>
> (MSVC Express 2005)
> in the above code 'XRE_InitEmbedding' failes with the result
> 0x80070057
> i'm new to the mozilla embedding. what did I miss?
>
> the startup folder of the application is the 'bin' directory of the
> XULrunner SDK.
> 'xul-runner.exe application.ini' http://developer.mozilla.org/
> en/docs/Getting_started_with_XULRunner">from this tutorial shows a
> 'Hello world' window
> thanks in advance
___
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding
