Hi dNafigator,
    Thanks a lot. I get it done. My previous compile error is due to
the miss of "nsIWebProgress.h", I simple include it and get it
compiled.
    You have very detailed explanation on how to use these macros,
great! I guess they are done in a slightly different way in mozembed
in the .cpp part. The code is using NS_IMPL_ISUPPORT[#] macro.
    Seems the semantic of Documentloaded() is for subframe, I suggest
the document of that function be refined, I don't know how to do that
change for the code base document, Boris, any help on that part?


On May 13, 12:35 am, dNafigator <dnafiga...@gmail.com> wrote:
> > I guess nsIWebProgress is a virtual class/class template and I need
>
> some specific way to realize it?
>
> Yes, you're right.
> In my code this is done in such a way:
>
> .h
> class CBrowserWnd : *many public base classes, and among them:* public
> nsIWebProgressListener
> {
> //many NS_DECL_* and among them:
>     NS_DECL_NSIWEBPROGRESSLISTENER //this macro contains declarations
> for methods from nsIWebProgressListener, no need to type them manyally
>
> };
>
> .cpp
>
> NS_IMPL_ADDREF(CBrowserWnd)
> NS_IMPL_RELEASE(CBrowserWnd)
>
> NS_INTERFACE_MAP_BEGIN(CBrowserWnd)
> //many NS_INTERFACE_MAP_ENTRY and some
> NS_INTERFACE_MAP_ENTRY_AMBIGUOUS
>    NS_INTERFACE_MAP_ENTRY(nsIWebProgressListener)
> NS_INTERFACE_MAP_END
>
> //and later in the same .cpp the implementation of 5 methods of
> nsIWebProgressListener:
>
> NS_IMETHODIMP CBrowserWnd::OnProgressChange(nsIWebProgress *progress,
> nsIRequest *request,
>                                                   PRInt32
> curSelfProgress, PRInt32 maxSelfProgress,
>                                                   PRInt32
> curTotalProgress, PRInt32 maxTotalProgress)
> {
> //some code
>
> }
>
> NS_IMETHODIMP CBrowserWnd::OnStateChange ( nsIWebProgress *progress,
> nsIRequest *request, PRUint32 progressStateFlags, nsresult status )
> {
> //some code
>
> }
>
> NS_IMETHODIMP CBrowserWnd::OnLocationChange ( nsIWebProgress*
> aWebProgress, nsIRequest* aRequest, nsIURI *location )
> {
> //the code from my prev. message
>
> }
>
> NS_IMETHODIMP CBrowserWnd::OnStatusChange ( nsIWebProgress*
> aWebProgress, nsIRequest* aRequest, nsresult aStatus, const PRUnichar*
> aMessage )
> {
>     return NS_OK;
>
> }
>
> NS_IMETHODIMP CBrowserWnd::OnSecurityChange ( nsIWebProgress
> *aWebProgress, nsIRequest *aRequest, PRUint32 state )
> {
>     return NS_OK;
>
> }

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

Reply via email to