On May 12, 12:10 am, dNafigator <dnafiga...@gmail.com> wrote:
> On May 12, 9:08 am, dNafigator <dnafiga...@gmail.com> wrote:> DocumentLoaded 
> executes every time any frame or iframe etc on page is
> > loaded. the way to check, wheather there was a main document loaded
> > was described at WinEmbed (or MFCEmbed, or somewhere else)
>
> sorry, bad copy-paste :)


Hi, Thanks a lot for this message, it is a big hint for me. But when I
am trying to do the same thing, I got a compile error,

../../common/WebBrowserChrome.cpp:233:  error: invalid use of
incomplete type   struct nsIWebProgress
/usr/include/xulrunner-1.9.0.9/unstable/nsIWebProgressListener.h:17:
error: forward declaration of   struct nsIWebProgress

I am doing this in WebBrowserChrome.cpp,    in

NS_IMETHODIMP WebBrowserChrome::OnProgressChange(nsIWebProgress *
aWebProgress,
                                                 nsIRequest *
aRequest,
                                                 PRInt32
aCurSelfProgress,
                                                 PRInt32
aMaxSelfProgress,
                                                 PRInt32
aCurTotalProgress,
                                                 PRInt32
aMaxTotalProgress)

 I guess nsIWebProgress is a virtual class/class template and I need
some specific way to realize it?

thanks.
Hui





>
> NS_IMETHODIMP CBrowserWnd::OnLocationChange ( nsIWebProgress*
> aWebProgress, nsIRequest* aRequest, nsIURI *location )
> {
>         bool isSubFrameLoad = false; // Is this a subframe load
>         if ( aWebProgress )
>         {
>                 nsCOMPtr<nsIDOMWindow>  domWindow;
>                 nsCOMPtr<nsIDOMWindow>  topDomWindow;
>                 aWebProgress->GetDOMWindow ( getter_AddRefs ( domWindow ) );
>                 if ( domWindow )
>                 {
>                         domWindow->GetTop ( getter_AddRefs ( topDomWindow ) );
>                 }
>                 isSubFrameLoad = PR_TRUE == ( domWindow != topDomWindow );
>         }
>
>         if ( !isSubFrameLoad )
>         {
>                 //main frame load
>         }
>         return NS_OK;
>
> }

_______________________________________________
dev-embedding mailing list
dev-embedding@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-embedding

Reply via email to