Re: IDispatch and dispinterface
"George" <George@discussions.microsoft.com> wrote in message
news:75322256-2F72-43FD-B52F-F124EAADD7C6@microsoft.com
I don't understand. How precisely do you plan to "provide vtable
based access" for methods in dispinterface? Wouldn't you have to
turn it into dual interface?
What I mean is when COM consumer QueryInterface for IMyDispatch, it
returns vtable pointer (i.e. interface pointer), the vtable contains
not only the 7 methods in IDispatch, but also methods show and
computeit from vtable.
Then, by definition, IMyDispatch is not a dispinterface, and it looks
very much like a dual interface. Why then not just declare it as such?
In this way, COM consumer could consume
dispinterface like dual interface.
No. In this way, the interface _is_ a dual interface. If it walks like a
duck, and quacks like a duck, it's a duck.
My question is, if I provide vtable based access
for dispinterface IMyDispatch, like show method, ATL and COM does not
prohibits this, correct?
No. COM even has a special term to describe such an interface - "dual".
--
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