the IDispatch

 

IDispatch   is   one   of   the   ubiquitously   implemented   interfaces   of   ActiveX   controls.

 

In   an   ActiveX   client,   IDispatch::Invoke   should   be   used   to   get   and   set   the   values   of   properties,  
or   to   call   a   method   of   an   ActiveX   object.  

The   dispIdMember   argument   identifies   the   member   to   invoke.  
The   DISPIDs   that   identify   members   are   defined   by   the   implementor   of   the   object   and   can   be   determined   by   using   the   object 's   documentation, 
 the   IDispatch::GetIDsOfNames   function,   or   the   ITypeInfo   interface.

When   you   use   IDispatch::Invoke()   with   DISPATCH_PROPERTYPUT   or   DISPATCH_PROPERTYPUTREF,  
you   have   to   specially   initialize   the   cNamedArgs   and   rgdispidNamedArgs   elements   of   your   DISPPARAMS   structure   with   the   following:  

DISPID   dispidNamed   =   DISPID_PROPERTYPUT;
dispparams.cNamedArgs   =   1;
dispparams.rgdispidNamedArgs   =   &dispidNamed;

The   information   that   follows   addresses   developers   of   ActiveX   clients   and   others   who   use   code   to   expose   ActiveX   objects.
It   describes   the   behavior   that   users   of   exposed   objects   should   expect.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章