Re: How to catch DISPID_CLICK event ?



Seb <kipcool.sb@xxxxxxxxx> wrote:
> My new piece of code:
>
> class ATL_NO_VTABLE CMyClass :
> ...
> public IDispEventImpl<1, CMyClass, &DIID_DWebBrowserEvents2,
> &LIBID_SHDocVw, 1, 1>,
> public IDispatchImpl<IMyClass, &IID_MyClass, &LIBID_MYCLASSLib>
>
> BEGIN_SINK_MAP(CMyClass)
> SINK_ENTRY_EX(1, DIID_DWebBrowserEvents2, DISPID_CLICK, OnClick)

WebBrowser still does not have any "click" event.

> SINK_ENTRY_EX(1, DIID_DWebBrowserEvents2, DISPID_DOCUMENTCOMPLETE,
> DocumentComplete)
> END_SINK_MAP()
>
> I don't advise my sinks because I don't know this :(

Your code is almost there, except for that reinterpret_cast. But it's
easier to just call DispEventAdvise you inherited from IDispEventImpl:

DispEventAdvise(pWebBrowser);

pWebBrowser is a pointer to WebBrowser instance (does not matter which
interface). There's also DispEventUnadvise method whose purpose should
be obvious.

> How to write my other advise ?

What other advise?
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925


.



Relevant Pages

  • Re: WebBrowser Control Events
    ... However, the DocumentComplete, ... NavigateComplete2 and a couple of other events I tried do not trigger when ... the user navigates in that WebBrowser Control - what am I doing wrong? ... Private Sub WebBrowser1_Navigated(ByVal sender As System.Object, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Waiting for internet explorer /webbrowser control to finish downloading
    ... If you navigate to a PDF-document, DocumentComplete is fired before Acrobat ... shows the document in the webbrowser! ... DoEvents ... What code will you put to wait web till it finish downloading? ...
    (microsoft.public.vb.general.discussion)
  • Re: webbrowser control disappears
    ... in beforenavigate and documentcomplete ... events i print the URL parameter and it is correct but the webbrowser ... control dissapears, ... See if this helps: KB Article KB253219 "PRB: WebBrowser Control ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)