🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.web
Article #1310

Re: I successed webbrowser coustomization partly.. plz help more..

#1310
From: Remy Lebeau (TeamB)
Date: Thu, 17 Mar 2005 18:17
44 lines
2786 bytes
"jini" <fseconds@hotmail.com> wrote in message
news:4239501e$1@newsgroups.borland.com...

>     (4) class myIDispatch :public IDispatch // <--- NOT WORK!!!!

Why are you implementing IDispatch from scratch?  At the very least, you
should use the existing IDispatchImpl class to simplify the work.

>             if (iid == IID_IUnknown) *ppvObject = this->pmyIDispatch;

That is not the correct thing to do.  You need to return a pointer to the
class that is being queried:

    if( iid == IID_IUnknown ) *ppvObject = (IUnknown*)this;

>             else if (iid == IID_IOleClientSite) *ppvObject =
> (IOleClientSite*)this;
>             else if (iid == IID_IDocHostUIHandler) *ppvObject =
> this->pmyIDocHostUIHandler;
>             else if (iid == IID_IDocHostShowUI) *ppvObject =
> this->pmyIDocHostShowUI;

I would suggest implementing all of the interfaces in the same class, not
separate classes.  This you can return 'this' for all of them.

>             ShowMessage(dispidMember); // <--  it display just two
> messages -5501, -5502

-5501 = DISPID_AMBIENT_OFFLINEIFNOTCONNECTED

-5502 = DISPID_AMBIENT_SILENT

>                 case DISPID_NEWWINDOW2:
>                 case DISPID_BEFORENAVIGATE2:

To receive those events, you need to attach to the browser's
DWebBrowserEvents2 ConnectionPoint.  Query the IWebBrowser2 interface for
IConnectionPointContainer, retreive the IConnectionPoint for
DIID_DWebBrowserEvents2, and add your IDispatch by calling
IConnectionPoint::Advise().


Gambit
Technical Details
Message-ID: <4239c9a1$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!tudelft.nl!feeder2.cambrium.nl!feed.tweaknews.nl!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!feeder.xsnews.nl!feeder.news-service.com!newsfeed.freenet.de!80.239.136.22.MISMATCH!tsicnews.teliasonera.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <422d9caa@newsgroups.borland.com> <422de978@newsgroups.borland.com> <422fc828$1@newsgroups.borland.com> <42307cb7$3@newsgroups.borland.com> <4239501e$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,2e915bcaf988658
X-Google-Attributes: gidfeeec,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.internet.web
References: <422d9caa@newsgroups.borland.com> <422de978@newsgroups.borland.com> <422fc828$1@newsgroups.borland.com> <42307cb7$3@newsgroups.borland.com> <4239501e$1@newsgroups.borland.com>
Subject: Re: I successed webbrowser coustomization partly.. plz help more..
Date: Thu, 17 Mar 2005 10:17:45 -0800
Lines: 46
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <4239c9a1$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1111083425 68.69.17.41 (17 Mar 2005 10:17:05 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!tudelft.nl!feeder2.cambrium.nl!feed.tweaknews.nl!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!feeder.xsnews.nl!feeder.news-service.com!newsfeed.freenet.de!80.239.136.22.MISMATCH!tsicnews.teliasonera.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail