| |||
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. |
#2
| |||
| |||
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. |
#3
| |||
| |||
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. |
'COM, ATL' 카테고리의 다른 글
싱크 부분 구현 참조..... (2) | 2008.08.28 |
---|---|
How ATL Implements Connections (0) | 2008.08.28 |
http://blog.naver.com/c_user/40052542493 - 블로그 링크 com atl 자료 링크 (1) | 2008.08.28 |
The AtlSink.exe sample demonstrates how to implement a dispinterface sink by using the Active Template Library (ATL) in Visual C++ (1) | 2008.08.28 |
Dispinterface vs. Events and Runtime Sinks - 싱크에서 디스핀터페이스 사용 코딩 구현 참조 (0) | 2008.08.28 |
표준 마샬링 좋은 예제 (1) | 2008.08.28 |
ATL and Dual Interfaces (0) | 2008.08.28 |