-
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.
-
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.
-
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks