From 189313c2368e27db535d76ee9fe4f8f569bbe360 Mon Sep 17 00:00:00 2001 From: loesje_ Date: Mon, 19 Mar 2012 15:45:09 +0000 Subject: [PATCH] * Added error message with the hint to specify the libxpcom-filename when xulrunner failed to load git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2359 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../geckoport/version2/SampleApps/GBrowser.dpr | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/components/geckoport/version2/SampleApps/GBrowser.dpr b/components/geckoport/version2/SampleApps/GBrowser.dpr index 66263d7a0..e94dbb1c8 100644 --- a/components/geckoport/version2/SampleApps/GBrowser.dpr +++ b/components/geckoport/version2/SampleApps/GBrowser.dpr @@ -7,7 +7,9 @@ uses Math, {$ENDIF} {$ENDIF} + sysutils, Forms, + GeckoInit, gec10 in 'gec10.pas'; @@ -20,6 +22,18 @@ begin {$ENDIF} Application.Initialize; - Application.CreateForm(TForm1, Form1); - Application.Run; + try + GeckoComponentsStartup(ParamStr(1)); + except + on E: Exception do + raise Exception.CreateFmt('Failed to initialize xulrunner. Try to pass the complete filename ' + + 'of the libxpcom library (including the path) as first parameter to ' + + 'the command line. Original error message: %s', [E.Message]); + end; + try + Application.CreateForm(TForm1, Form1); + Application.Run; + finally + GeckoComponentsShutdown; + end; end.