Re: nsIDOMWindow->GetContentDOMWindow problem

2011-12-20 Thread philippe
On 18 déc, 18:32, Tom  wrote:
> It's happening to me as well. I've been embedding Gecko for many years
> (in MathCast). Something has changed dramatically lately. And I get an
> exception in nsDocShellTreeOwner.cpp line 889, nsEventListenerManager*
> elmP = target->GetListenerManager(PR_TRUE);
>
> I've compiled SeaMonkey 2.5.
>
> It also seems that WinEmbed has the same exception. MFCEmbed and the
> other samples are gone.
>
> I pretty much don't know what to do, and I'll appreciate any help.
>
> Thank you very much.

OK I Solved the problem

The mozilla's architecture changed.


nsCOMPtr  domWindow;

nsCOMPtr mWebNavigation;
nsCOMPtr myDomDoc;
nsCOMPtr myHtmlDoc;


mWebNavigation = do_QueryInterface(mWebBrowser, &result);
result = mWebNavigation->GetDocument(getter_AddRefs(myDomDoc));
myHtmlDoc = do_QueryInterface(myDomDoc);

After I can go through the DOM and the HTML.

Thank's for your help here is where I got the information
http://doxygen.db48x.net/mozilla-full/html/d6/d13/interfacensIDocShellTreeItem.html
(All the classes).

philippe

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


Re: nsIDOMWindow->GetContentDOMWindow problem

2011-12-18 Thread Tom

It's happening to me as well. I've been embedding Gecko for many years
(in MathCast). Something has changed dramatically lately. And I get an
exception in nsDocShellTreeOwner.cpp line 889, nsEventListenerManager*
elmP = target->GetListenerManager(PR_TRUE);

I've compiled SeaMonkey 2.5.

It also seems that WinEmbed has the same exception. MFCEmbed and the
other samples are gone.

I pretty much don't know what to do, and I'll appreciate any help.

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


Re: nsIDOMWindow->GetContentDOMWindow problem

2011-12-06 Thread philippe
On 5 déc, 15:13, philippe  wrote:
> I use gecko 1.9.2.23
>
> I have an error when I use the GetContentDomWindow on a
> nsIWebBrowserObject
>
> What I do before is:
>
> I create a browser into a window. I navigate on a page using loadURI.
> The page is OK
>
> I trap a key input and start to execute some code into my chrome when
> a key is pressed.
>
> Here is the code
>
>     nsIDOMWindow* domWindow=NULL;
>         rv=mWebBrowser->GetContentDOMWindow(&domWindow);
>
>     nsCOMPtr
> theGlobalObjectOwner(do_GetInterface(domWindow));
>
> But domWindow is NULL and rv=mWebBrowser-
>
> >GetContentDOMWindow(&domWindow); returns 0x80004002.
>
> What is wrong with y code. Do you have some sample ?
>
> THank's a lot for your responses
>
> philippe

Here is my InitialisationProcess

In the container

rv = XPCOMGlueStartup(xpcomPath);
...
rv = XRE_InitEmbedding(xuldir, nsnull, nsnull, nsnull, 0);



Then in the chrome class
(nsIInterfaceRequestor,nsIWebBrowserChrome,nsIWebBrowserChromeFocus,nsIEmbeddingSiteWindow,nsIWebProgressListener,nsSupportsWeakReference)

NS_INTERFACE_MAP_BEGIN(WebBrowserChrome)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIWebBrowserChrome)
   NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
   NS_INTERFACE_MAP_ENTRY(nsIWebBrowserChrome)
   NS_INTERFACE_MAP_ENTRY(nsIWebBrowserChromeFocus)
   NS_INTERFACE_MAP_ENTRY(nsIEmbeddingSiteWindow)
   NS_INTERFACE_MAP_ENTRY(nsIWebProgressListener)
   NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
NS_INTERFACE_MAP_END


mWebBrowser =
do_CreateInstance(NS_WEBBROWSER_CONTRACTID,&rv);   //
nsCOMPtr   mWebBrowser (class member)

   nsCOMPtr
webBrowserAsSetup(do_QueryInterface(mWebBrowser));
   webBrowserAsSetup-
>SetProperty(nsIWebBrowserSetup::SETUP_ALLOW_JAVASCRIPT, allowJS); //
alowJS equals PR_TRUE

   (void)mWebBrowser-
>SetContainerWindow(static_cast( this));

nsCOMPtr dsti =
do_QueryInterface(mWebBrowser);
dsti->SetItemType(nsIDocShellTreeItem::typeContentWrapper);

browserBaseWindow = do_QueryInterface(mWebBrowser); //
nsCOMPtr browserBaseWindow (class member)

// creates the native window
RealWebBrowserEmbedded* embedder; // container class
embedder =
static_cast(mypWebBrowserEmbedded); //
RealWebBrowserEmbedded*   mypWebBrowserEmbedded; (class member)
WebBrowserContainer* container = embedder->getContainer();
mNativeWindow =
WebBrowserChromeUI::CreateNativeWindow(static_cast( 
this),container); //
creates a WINDOWs hWnd

   rv=browserBaseWindow->InitWindow( mNativeWindow, nsnull, aX, aY,
aCX, aCY);

  rv=browserBaseWindow->Create();

   nsCOMPtr
listener(static_cast( this));
nsCOMPtr
thisListener(do_GetWeakReference(listener));

(void)mWebBrowser->AddWebBrowserListener(thisListener,
NS_GET_IID(nsIWebProgressListener));

browserBaseWindow->SetVisibility(PR_TRUE);

nsCOMPtr
browserAsFocus=do_QueryInterface(mWebBrowser);
browserAsFocus->Activate();
if (mWebBrowser)
{
*aBrowser = mWebBrowser; // arg nsIWebBrowser*
NS_ADDREF(*aBrowser);
return NS_OK;
}


This Initialisation returns NS_OK

What is wrong ?


Thak's for your responses





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


nsIDOMWindow->GetContentDOMWindow problem

2011-12-05 Thread philippe
I use gecko 1.9.2.23

I have an error when I use the GetContentDomWindow on a
nsIWebBrowserObject

What I do before is:

I create a browser into a window. I navigate on a page using loadURI.
The page is OK

I trap a key input and start to execute some code into my chrome when
a key is pressed.

Here is the code

nsIDOMWindow* domWindow=NULL;
rv=mWebBrowser->GetContentDOMWindow(&domWindow);


nsCOMPtr
theGlobalObjectOwner(do_GetInterface(domWindow));


But domWindow is NULL and rv=mWebBrowser-
>GetContentDOMWindow(&domWindow); returns 0x80004002.

What is wrong with y code. Do you have some sample ?

THank's a lot for your responses

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