On Tue, Nov 8, 2011 at 10:33 AM, Sunil Kumar <badboy...@gmail.com> wrote:
> > > On Mon, Nov 7, 2011 at 8:26 PM, g...@novadsp.com <g...@novadsp.com> wrote: > >> Hi Sunil >> >> How 'headless' does it need to be? And for which OS? >> >> >> On 07/11/2011 13:37, Sunil Kumar wrote: >> >>> Is there any documentation for 'offscreen' branch? >>> >>> On Mon, Nov 7, 2011 at 7:05 PM, Sunil Kumar<badboy...@gmail.com> wrote: >>> >>> I wish it was there. >>>> I could not find any proper documentation for this. >>>> This code is taken from bits of codes from many projects. >>>> >>>> On Mon, Nov 7, 2011 at 6:46 PM, Glen Gray<sla...@slaine.org> wrote: >>>> >>>> Is there an online how-to/tutorial for using the below methods ? >>>>> >>>>> >>>>> On 3 Nov 2011, at 13:12, Sunil Kumar wrote: >>>>> >>>>> I need to know what all I need to do and in Which order to load a URL >>>>>> in >>>>>> nsWebBrowser instance. >>>>>> >>>>>> In reality I get NS_ERROR_UNEXPECTED(**0x8000FFFF) when I run >>>>>> following >>>>>> >>>>> code. >>>>> >>>>>> >>>>>> <code> >>>>>> #include<iostream> >>>>>> #include<xpcom-config.h> >>>>>> #include<nsXPCOMGlue.h> >>>>>> #include<nsXPCOM.h> >>>>>> #include<nsCOMPtr.h> >>>>>> #include<nsStringAPI.h> >>>>>> #include<nsEmbedString.h> >>>>>> #include<nsILocalFile.h> >>>>>> #include<nsIWebBrowser.h> >>>>>> #include<nsCWebBrowser.h> >>>>>> #include<nsIWebNavigation.h> >>>>>> #include<**nsComponentManagerUtils.h> >>>>>> #include<**nsServiceManagerUtils.h> >>>>>> >>>>>> using namespace std; >>>>>> >>>>>> int main() >>>>>> { >>>>>> nsresult rv; >>>>>> nsCOMPtr<nsILocalFile> bin_dir; >>>>>> rv = NS_NewLocalFile(nsEmbedString(**L"C:\\xulrunner-sdk\\bin"), >>>>>> PR_FALSE, >>>>>> getter_AddRefs(bin_dir)); >>>>>> if(NS_FAILED(rv)) >>>>>> { >>>>>> cout<<"Failed for file. rv="<<rv<<endl; >>>>>> exit(-1); >>>>>> } >>>>>> printf("Initializing\n"); >>>>>> >>>>>> nsCOMPtr<nsIServiceManager> sm; >>>>>> rv = NS_InitXPCOM2(getter_AddRefs(**sm), bin_dir, nsnull); >>>>>> if(NS_FAILED(rv)) >>>>>> { >>>>>> cout<<"Failed INIT. rv="<<rv<<endl; >>>>>> exit(-2); >>>>>> } >>>>>> >>>>>> printf("Creating Browser components\n"); >>>>>> nsCOMPtr<nsIWebBrowser> nsBrowser; >>>>>> nsBrowser = do_CreateInstance(NS_**WEBBROWSER_CONTRACTID,&rv); >>>>>> if(NS_FAILED(rv)) >>>>>> cout<<"Failed to create Browser, rv:"<<rv<<endl; >>>>>> >>>>>> nsCOMPtr<nsIWebNavigation> nsWebNav; >>>>>> nsWebNav = do_QueryInterface(nsBrowser,&**rv); >>>>>> if(NS_FAILED(rv)) >>>>>> cout<<"Failed to create WebNav, Code:"<<rv<<endl; >>>>>> >>>>>> char* uri = "http://www.google.com"; >>>>>> rv = nsWebNav->LoadURI((const PRUnichar *)uri, >>>>>> nsIWebNavigation::LOAD_FLAGS_**NONE, nsnull, nsnull, nsnull); >>>>>> if(NS_FAILED(rv)) >>>>>> cout<<"Failed to load URI, rv:"<<rv<<endl; >>>>>> else >>>>>> cout<<"URI Loaded. HoooLaalaa\n"; >>>>>> >>>>>> cout<<"Shutting Down\n"; >>>>>> NS_ShutdownXPCOM(nsnull); >>>>>> cout<<"Done...\n"; >>>>>> //getchar(); >>>>>> return rv; >>>>>> } >>>>>> </code> >>>>>> >>>>>> Any help with this? Please. >>>>>> -- >>>>>> Your smile is the most precious thing that doesn't cost you. Keep >>>>>> >>>>> smiling. >>>>> >>>>>> :) >>>>>> =============== >>>>>> SunilKumar >>>>>> ------------------------------ >>>>>> http://in.linkedin.com/in/**sunilkr86/<http://in.linkedin.com/in/sunilkr86/> >>>>>> =============== >>>>>> ______________________________**_________________ >>>>>> dev-embedding mailing list >>>>>> dev-embedding@lists.mozilla.**org <dev-embedding@lists.mozilla.org> >>>>>> https://lists.mozilla.org/**listinfo/dev-embedding<https://lists.mozilla.org/listinfo/dev-embedding> >>>>>> >>>>> >>>>> -- >>>>> Glen Gray >>>>> <sla...@slaine.org> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>> >>>> -- >>>> Your smile is the most precious thing that doesn't cost you. Keep >>>> smiling. >>>> :) >>>> =============== >>>> SunilKumar >>>> ------------------------------ >>>> http://in.linkedin.com/in/**sunilkr86/<http://in.linkedin.com/in/sunilkr86/> >>>> =============== >>>> >>>> >>>> >>> >>> >> >> > I m a newbie in embedding mozilla. > But it should be OS neutral. > > > -- > Your smile is the most precious thing that doesn't cost you. Keep smiling. > :) > =============== > SunilKumar > ------------------------------ > http://in.linkedin.com/in/sunilkr86/ > =============== > > i have added a GtkWindow to nsIBaseWindow and now it crashes at EIP 0x49. line: "nsBaseWindow->Create();" <code> nsCOMPtr<nsIWebNavigation> nsNav; nsNav = do_QueryInterface(nsBrowser, &rv); nsCOMPtr<nsIBaseWindow> nsBaseWindow; nsBaseWindow = do_QueryInterface(nsBrowser, &rv); nsCOMPtr<nsIWebBrowserFocus> nsWBFocus; nsWBFocus = do_QueryInterface(nsBrowser,&rv); GtkWidget* gtkWindow = InitWindow(); nsBaseWindow->InitWindow((nativeWindow) gtkWindow, nsnull, 0, 0, 500, 500); nsBaseWindow->Create(); cout<<"Loading URL...\n"; rv = nsNav->LoadURI((PRUnichar*)"http://www.google.com", nsIWebNavigation::LOAD_FLAGS_NONE, nsnull, nsnull, nsnull); </code> -- Your smile is the most precious thing that doesn't cost you. Keep smiling. :) =============== SunilKumar ------------------------------ http://in.linkedin.com/in/sunilkr86/ =============== _______________________________________________ dev-embedding mailing list dev-embedding@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-embedding