DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    vohan Guest

    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. #2
    Ed Guest

    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. #3
    Andy Friedman Guest

    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.



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


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


Sponsored Links