Re: Simple implementation of IDispatch for HTMLEvents??



<key88sf@xxxxxxxxx> wrote in message
news:1177306613.219345.100940@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Apr 22, 8:51 pm, "Igor Tandetnik" <itandet...@xxxxxxxx> wrote:
You don't need to implement any methods except Invoke. The other
three are never called on the event sink. Invoke is called with a
dispid of DISPID_VALUE and, I believe, a single parameter referring
to the element that fires the event.

So are you saying I dont even need to derive from IDispatch ?

You do. You simply return E_NOTIMPL from all methods except Invoke.

My problem is really just trying to get this thing
to *compile* when deriving from IDispatchImpl<> or similar classes.

Don't derive from IDispatchImpl, derive from IDispatch directly.

Is
there an example somewhere I can see?

http://support.microsoft.com/kb/181277

"Using ATL to Implement Only IUnknown" section.
--
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: Simple implementation of IDispatch for HTMLEvents??
    ... and I can just override the ... You don't need to implement any methods except Invoke. ... are never called on the event sink. ... So are you saying I dont even need to derive from IDispatch? ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • Re: sp_OACreate simple question
    ... Because TSQL's sp_OACreate can only invoke via IDispatch, ... such libraries are invoked under SQL Server, any dialogs have no-where to go ...
    (microsoft.public.sqlserver.programming)
  • Re: COM Interop (calling late bound IDispatch based method within C#)
    ... The managed NotSupportedException I am getting from Type.InvokeMember appears to be intentional. ... So I guess this isn't a supported way to late bind to IDispatch based interfaces. ... Usually I would use GetMethod et al and call Invoke on the MemberInfo instance returned. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Listen to CP Events in MFC App
    ... Make sure your event implementation really implements IDispatch. ... > Code snippet of the event sink class that i implemented in my MFC ...
    (microsoft.public.vc.atl)
  • Re: Typelib issue
    ... instance vtable to achieve function pointer is better -- in essence, ... Like I said, if you want to know what IDispatch is for, there's copious ... "access vtable address directly" from inside your Invoke implementation. ...
    (microsoft.public.vc.language)