Re: Embedding basics

2011-11-28 Thread Glen Gray
Hey Sunil,

I was wondering if you ever solved your problem here ?

On 8 Nov 2011, at 05:17, Sunil Kumar wrote:

> On Tue, Nov 8, 2011 at 10:33 AM, Sunil Kumar  wrote:
> 
>> 
>> 
>> On Mon, Nov 7, 2011 at 8:26 PM, [email protected]  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  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  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(**0x8000) when I run
>>> following
>>> 
>> code.
>> 
>>> 
>>> 
>>> #include
>>> #include
>>> #include
>>> #include
>>> #include
>>> #include
>>> #include
>>> #include
>>> #include
>>> #include
>>> #include
>>> #include<**nsComponentManagerUtils.h>
>>> #include<**nsServiceManagerUtils.h>
>>> 
>>> using namespace std;
>>> 
>>> int main()
>>> {
>>> nsresult rv;
>>> nsCOMPtr  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="<>> exit(-1);
>>> }
>>> printf("Initializing\n");
>>> 
>>> nsCOMPtr  sm;
>>> rv = NS_InitXPCOM2(getter_AddRefs(**sm), bin_dir, nsnull);
>>> if(NS_FAILED(rv))
>>> {
>>> cout<<"Failed INIT. rv="<>> exit(-2);
>>> }
>>> 
>>> printf("Creating Browser components\n");
>>> nsCOMPtr  nsBrowser;
>>> nsBrowser = do_CreateInstance(NS_**WEBBROWSER_CONTRACTID,&rv);
>>> if(NS_FAILED(rv))
>>> cout<<"Failed to create Browser, rv:"<>> 
>>> nsCOMPtr  nsWebNav;
>>> nsWebNav = do_QueryInterface(nsBrowser,&**rv);
>>> if(NS_FAILED(rv))
>>> cout<<"Failed to create WebNav, Code:"<>> 
>>> 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:"<>> else
>>> cout<<"URI Loaded. HoooLaalaa\n";
>>> 
>>> cout<<"Shutting Down\n";
>>> NS_ShutdownXPCOM(nsnull);
>>> cout<<"Done...\n";
>>> //getchar();
>>> return rv;
>>> }
>>> 
>>> 
>>> 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/
>>> ===
>>> __**_
>>> dev-embedding mailing list
>>> [email protected].**org 
>>> https://lists.mozilla.org/**listinfo/dev-embedding
>>> 
>> 
>> --
>> Glen Gray
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
> 
> --
> Your smile is the most precious thing that doesn't cost you. Keep
> smiling.
> :)
> ===
> SunilKumar
> --
> 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();"
> 
> 
> 
>nsCOMPtr nsNav;
> nsNav = do_QueryInterface(nsBrowser, &rv);
> nsCOMPtr nsBaseWindow;
> nsBaseWindow = do_QueryInterface(nsBrowser, &rv);
> nsCOMPtr 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);
> 
> 
> -- 
> Your smile is the most precious thing that doesn't cost you. Keep smiling.
> :)
> ===
> SunilKumar
> 

Re: Embedding basics

2011-11-07 Thread Sunil Kumar
On Tue, Nov 8, 2011 at 10:33 AM, Sunil Kumar  wrote:

>
>
> On Mon, Nov 7, 2011 at 8:26 PM, [email protected]  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  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  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(**0x8000) when I run
>> following
>>
> code.
>
>>
>> 
>> #include
>> #include
>> #include
>> #include
>> #include
>> #include
>> #include
>> #include
>> #include
>> #include
>> #include
>> #include<**nsComponentManagerUtils.h>
>> #include<**nsServiceManagerUtils.h>
>>
>> using namespace std;
>>
>> int main()
>> {
>> nsresult rv;
>> nsCOMPtr  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="<> exit(-1);
>> }
>> printf("Initializing\n");
>>
>> nsCOMPtr  sm;
>> rv = NS_InitXPCOM2(getter_AddRefs(**sm), bin_dir, nsnull);
>> if(NS_FAILED(rv))
>> {
>> cout<<"Failed INIT. rv="<> exit(-2);
>> }
>>
>> printf("Creating Browser components\n");
>> nsCOMPtr  nsBrowser;
>> nsBrowser = do_CreateInstance(NS_**WEBBROWSER_CONTRACTID,&rv);
>> if(NS_FAILED(rv))
>> cout<<"Failed to create Browser, rv:"<>
>> nsCOMPtr  nsWebNav;
>> nsWebNav = do_QueryInterface(nsBrowser,&**rv);
>> if(NS_FAILED(rv))
>> cout<<"Failed to create WebNav, Code:"<>
>> 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:"<> else
>> cout<<"URI Loaded. HoooLaalaa\n";
>>
>> cout<<"Shutting Down\n";
>> NS_ShutdownXPCOM(nsnull);
>> cout<<"Done...\n";
>> //getchar();
>> return rv;
>> }
>> 
>>
>> 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/
>> ===
>> __**_
>> dev-embedding mailing list
>> [email protected].**org 
>> https://lists.mozilla.org/**listinfo/dev-embedding
>>
>
> --
> Glen Gray
> 
>
>
>
>
>
>
>

 --
 Your smile is the most precious thing that doesn't cost you. Keep
 smiling.
 :)
 ===
  SunilKumar
 --
 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();"



nsCOMPtr nsNav;
 nsNav = do_QueryInterface(nsBrowser, &rv);
nsCOMPtr nsBaseWindow;
 nsBaseWindow = do_QueryInterface(nsBrowser, &rv);
nsCOMPtr 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);


-- 
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
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding


Re: Embedding basics

2011-11-07 Thread Sunil Kumar
On Mon, Nov 7, 2011 at 8:26 PM, [email protected]  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  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  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(**0x8000) when I run
> following
>
 code.

>
> 
> #include
> #include
> #include
> #include
> #include
> #include
> #include
> #include
> #include
> #include
> #include
> #include<**nsComponentManagerUtils.h>
> #include<**nsServiceManagerUtils.h>
>
> using namespace std;
>
> int main()
> {
> nsresult rv;
> nsCOMPtr  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="< exit(-1);
> }
> printf("Initializing\n");
>
> nsCOMPtr  sm;
> rv = NS_InitXPCOM2(getter_AddRefs(**sm), bin_dir, nsnull);
> if(NS_FAILED(rv))
> {
> cout<<"Failed INIT. rv="< exit(-2);
> }
>
> printf("Creating Browser components\n");
> nsCOMPtr  nsBrowser;
> nsBrowser = do_CreateInstance(NS_**WEBBROWSER_CONTRACTID,&rv);
> if(NS_FAILED(rv))
> cout<<"Failed to create Browser, rv:"<
> nsCOMPtr  nsWebNav;
> nsWebNav = do_QueryInterface(nsBrowser,&**rv);
> if(NS_FAILED(rv))
> cout<<"Failed to create WebNav, Code:"<
> 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:"< else
> cout<<"URI Loaded. HoooLaalaa\n";
>
> cout<<"Shutting Down\n";
> NS_ShutdownXPCOM(nsnull);
> cout<<"Done...\n";
> //getchar();
> return rv;
> }
> 
>
> 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/
> ===
> __**_
> dev-embedding mailing list
> [email protected].**org 
> https://lists.mozilla.org/**listinfo/dev-embedding
>

 --
 Glen Gray
 







>>>
>>> --
>>> Your smile is the most precious thing that doesn't cost you. Keep
>>> smiling.
>>> :)
>>> ===
>>>  SunilKumar
>>> --
>>> 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/
===
___
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding


Re: Embedding basics

2011-11-07 Thread [email protected]

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  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  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(0x8000) when I run following

code.



#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include

using namespace std;

int main()
{
nsresult rv;
nsCOMPtr  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="<  sm;
rv = NS_InitXPCOM2(getter_AddRefs(sm), bin_dir, nsnull);
if(NS_FAILED(rv))
{
cout<<"Failed INIT. rv="<  nsBrowser;
nsBrowser = do_CreateInstance(NS_WEBBROWSER_CONTRACTID,&rv);
if(NS_FAILED(rv))
cout<<"Failed to create Browser, rv:"<  nsWebNav;
nsWebNav = do_QueryInterface(nsBrowser,&rv);
if(NS_FAILED(rv))
cout<<"Failed to create WebNav, Code:"LoadURI((const PRUnichar *)uri,
nsIWebNavigation::LOAD_FLAGS_NONE, nsnull, nsnull, nsnull);
if(NS_FAILED(rv))
cout<<"Failed to load URI, rv:"<

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/
===
___
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding


--
Glen Gray










--
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
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding


Re: Embedding basics

2011-11-07 Thread Sunil Kumar
Is there any documentation for 'offscreen' branch?

On Mon, Nov 7, 2011 at 7:05 PM, Sunil Kumar  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  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(0x8000) when I run following
>> code.
>> >
>> > 
>> > #include
>> > #include
>> > #include
>> > #include
>> > #include
>> > #include
>> > #include
>> > #include
>> > #include
>> > #include
>> > #include
>> > #include
>> > #include
>> >
>> > using namespace std;
>> >
>> > int main()
>> > {
>> > nsresult rv;
>> > nsCOMPtr 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="<> > exit(-1);
>> > }
>> > printf("Initializing\n");
>> >
>> > nsCOMPtr sm;
>> > rv = NS_InitXPCOM2(getter_AddRefs(sm), bin_dir, nsnull);
>> > if(NS_FAILED(rv))
>> > {
>> > cout<<"Failed INIT. rv="<> > exit(-2);
>> > }
>> >
>> > printf("Creating Browser components\n");
>> > nsCOMPtr nsBrowser;
>> > nsBrowser = do_CreateInstance(NS_WEBBROWSER_CONTRACTID, &rv);
>> > if(NS_FAILED(rv))
>> > cout<<"Failed to create Browser, rv: "<> >
>> > nsCOMPtr nsWebNav;
>> > nsWebNav = do_QueryInterface(nsBrowser, &rv);
>> > if(NS_FAILED(rv))
>> > cout<<"Failed to create WebNav, Code:"<> >
>> > 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: "<> > else
>> > cout<<"URI Loaded. HoooLaalaa\n";
>> >
>> > cout<<"Shutting Down\n";
>> > NS_ShutdownXPCOM(nsnull);
>> > cout<<"Done...\n";
>> > //getchar();
>> > return rv;
>> > }
>> > 
>> >
>> > 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/
>> > ===
>> > ___
>> > dev-embedding mailing list
>> > [email protected]
>> > https://lists.mozilla.org/listinfo/dev-embedding
>>
>> --
>> Glen Gray
>> 
>>
>>
>>
>>
>>
>>
>
>
> --
> Your smile is the most precious thing that doesn't cost you. Keep smiling.
> :)
> ===
>  SunilKumar
> --
> http://in.linkedin.com/in/sunilkr86/
> ===
>
>


-- 
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
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding


Re: Embedding basics

2011-11-07 Thread Sunil Kumar
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  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(0x8000) when I run following
> code.
> >
> > 
> > #include
> > #include
> > #include
> > #include
> > #include
> > #include
> > #include
> > #include
> > #include
> > #include
> > #include
> > #include
> > #include
> >
> > using namespace std;
> >
> > int main()
> > {
> > nsresult rv;
> > nsCOMPtr 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="< > exit(-1);
> > }
> > printf("Initializing\n");
> >
> > nsCOMPtr sm;
> > rv = NS_InitXPCOM2(getter_AddRefs(sm), bin_dir, nsnull);
> > if(NS_FAILED(rv))
> > {
> > cout<<"Failed INIT. rv="< > exit(-2);
> > }
> >
> > printf("Creating Browser components\n");
> > nsCOMPtr nsBrowser;
> > nsBrowser = do_CreateInstance(NS_WEBBROWSER_CONTRACTID, &rv);
> > if(NS_FAILED(rv))
> > cout<<"Failed to create Browser, rv: "< >
> > nsCOMPtr nsWebNav;
> > nsWebNav = do_QueryInterface(nsBrowser, &rv);
> > if(NS_FAILED(rv))
> > cout<<"Failed to create WebNav, Code:"< >
> > 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: "< > else
> > cout<<"URI Loaded. HoooLaalaa\n";
> >
> > cout<<"Shutting Down\n";
> > NS_ShutdownXPCOM(nsnull);
> > cout<<"Done...\n";
> > //getchar();
> > return rv;
> > }
> > 
> >
> > 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/
> > ===
> > ___
> > dev-embedding mailing list
> > [email protected]
> > https://lists.mozilla.org/listinfo/dev-embedding
>
> --
> Glen Gray
> 
>
>
>
>
>
>


-- 
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
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding


Re: Embedding basics

2011-11-07 Thread Benjamin Smedberg

On 11/4/2011 1:25 AM, Sunil Kumar wrote:

I dont want to use Any GUI windows( gtk_window/Window), so I wont have the
Handle/Pointer to a real window.
How can I call BaseWindow.initWindow without having a Handle or Pointer to
real window?

Currently you cannot, a window is required.

For a while Chris Lord was working on a headless ("offscreen") version 
of gecko which did exactly what you want, but as far as I know that 
version is currently unmaintained, see 
http://hg.mozilla.org/incubator/offscreen but also see that the last 
commit was in March 2010.


--BDS

___
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding


Re: Embedding basics

2011-11-07 Thread Glen Gray
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(0x8000) when I run following code.
> 
> 
> #include
> #include
> #include
> #include
> #include
> #include
> #include
> #include
> #include
> #include
> #include
> #include
> #include
> 
> using namespace std;
> 
> int main()
> {
> nsresult rv;
> nsCOMPtr 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="< exit(-1);
> }
> printf("Initializing\n");
> 
> nsCOMPtr sm;
> rv = NS_InitXPCOM2(getter_AddRefs(sm), bin_dir, nsnull);
> if(NS_FAILED(rv))
> {
> cout<<"Failed INIT. rv="< exit(-2);
> }
> 
> printf("Creating Browser components\n");
> nsCOMPtr nsBrowser;
> nsBrowser = do_CreateInstance(NS_WEBBROWSER_CONTRACTID, &rv);
> if(NS_FAILED(rv))
> cout<<"Failed to create Browser, rv: "< 
> nsCOMPtr nsWebNav;
> nsWebNav = do_QueryInterface(nsBrowser, &rv);
> if(NS_FAILED(rv))
> cout<<"Failed to create WebNav, Code:"< 
> 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: "< else
> cout<<"URI Loaded. HoooLaalaa\n";
> 
> cout<<"Shutting Down\n";
> NS_ShutdownXPCOM(nsnull);
> cout<<"Done...\n";
> //getchar();
> return rv;
> }
> 
> 
> 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/
> ===
> ___
> dev-embedding mailing list
> [email protected]
> https://lists.mozilla.org/listinfo/dev-embedding

-- 
Glen Gray






___
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding


Re: Embedding basics

2011-11-03 Thread Sunil Kumar
I dont want to use Any GUI windows( gtk_window/Window), so I wont have the
Handle/Pointer to a real window.
How can I call BaseWindow.initWindow without having a Handle or Pointer to
real window?


On Thu, Nov 3, 2011 at 8:40 PM, Benjamin Smedberg wrote:

> On 11/3/2011 9:12 AM, Sunil Kumar wrote:
>
>> I need to know what all I need to do and in Which order to load a URL in
>> nsWebBrowser instance.
>>
> It looks like you have not initialize the webbrowser. As far as I know,
> you cannot use a webbrowser until you've set it up (using
> nsIBaseWindow.initWindow and nsIBaseWindow.create).
>
> But I'm not sure exactly what is necessary for setup.
>
> --BDS
>
>


-- 
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
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding


Re: Embedding basics

2011-11-03 Thread Benjamin Smedberg

On 11/3/2011 9:12 AM, Sunil Kumar wrote:

I need to know what all I need to do and in Which order to load a URL in
nsWebBrowser instance.
It looks like you have not initialize the webbrowser. As far as I know, 
you cannot use a webbrowser until you've set it up (using 
nsIBaseWindow.initWindow and nsIBaseWindow.create).


But I'm not sure exactly what is necessary for setup.

--BDS

___
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding