COM, ATL

what is different between dispinterface and interface in IDL ?

디버그정 2008. 8. 28. 06:30
vohan
 
Posts: n/a
what is different between dispinterface and interface in IDL ?


what is different between dispinterface and interface (with IDispatch) in
IDL ? And how to implement dispinterface methods and props in VC++ (prefer
ClassWizard) ?
Any help will be appreciated.
Reply With Quote
  #2  
Old 03-27-2001, 10:07 AM
Ed
 
Posts: n/a
Re: what is different between dispinterface and interface in IDL ?


"vohan" <vohan2@vol.vnn.vn> wrote:
>
>what is different between dispinterface and interface (with IDispatch) in
>IDL ? And how to implement dispinterface methods and props in VC++ (prefer
>ClassWizard) ?
>Any help will be appreciated.

Reference material: Professional ATL COM Programming by Dr. Richard Grimes
at WROX Press.

Dispinterface indicates that the component supports IDispatch. You can access
the methods for a dispinterface using IDispatch::Invoke(). Dispinterfaces
don't have to return an HRESULT because IDispatch::Invoke() will. So they
can have other return types in the definintion.

VC++ has several methods for member access:
_com_dispatch_propget()
_com_dispatch_propput()
_com_dispatch_method()
_com_dispatch_raw_propget()
_com_dispatch_raw_propput()
_com_dispatch_raw_method()
The prop methods use parameters indicating type of property.

I would suggest going over Chapters 1 and 3 in the Wrox book.

Selecting 'Support Connection Points' in the object Wizard will add a dispinterface
to the IDL for outgoing interface.
Reply With Quote
  #3  
Old 03-27-2001, 01:41 PM
Andy Friedman
 
Posts: n/a
Re: what is different between dispinterface and interface in IDL ?


In addition, a dispinterface is not part of the object's vtable. This is inconsequential
to scripting clients, but lowers performance considerably for VC++ clients.

The general rule of thumb is don't use dispinterfaces except for events.

Andy


"Ed" <emedina@enovasoftware.com> wrote:
>
>"vohan" <vohan2@vol.vnn.vn> wrote:
>>
>>what is different between dispinterface and interface (with IDispatch)

in
>>IDL ? And how to implement dispinterface methods and props in VC++ (prefer
>>ClassWizard) ?
>>Any help will be appreciated.

>Reference material: Professional ATL COM Programming by Dr. Richard Grimes
>at WROX Press.
>
>Dispinterface indicates that the component supports IDispatch. You can

access
>the methods for a dispinterface using IDispatch::Invoke(). Dispinterfaces
>don't have to return an HRESULT because IDispatch::Invoke() will. So they
>can have other return types in the definintion.
>
>VC++ has several methods for member access:
>_com_dispatch_propget()
>_com_dispatch_propput()
>_com_dispatch_method()
>_com_dispatch_raw_propget()
>_com_dispatch_raw_propput()
>_com_dispatch_raw_method()
>The prop methods use parameters indicating type of property.
>
>I would suggest going over Chapters 1 and 3 in the Wrox book.
>
>Selecting 'Support Connection Points' in the object Wizard will add a dispinterface
>to the IDL for outgoing interface.