Google
      
 35 1234
发新话题
打印

InvokeHelper()函数

InvokeHelper()函数

例如  invokehelper(0x60030005,   dispatch_method,   vt_bool,   (void*)&result,   null);   
       在COM中用来调用COM组件的方法,传递参数等,是一个通用的函数什么都可以调,是vc自动生成的,不用去管它。

使用此函数   调用控件的属性或方法,属性或方法由第一个参数决定
CWnd::InvokeHelper
void InvokeHelper( DISPID dwDispID, WORD wFlags, VARTYPE vtRet, void* pvRet, const BYTE* pbParamInfo, ... );
说明:
Call this member function to invoke the OLE control method or property specified by dwDispID, in the context specified by wFlags.
其中参数:
dwDispID:
//Identifies the method or property to be invoked. This value is usually supplied by Component Gallery.
wFlags:可以为下面些值,指明调用InvokeHelper的目的。
//[ DISPATCH_METHOD ]   The member is invoked as a method. If a property has the same name, both this and the DISPATCH_PROPERTYGET flag may be set.
[ DISPATCH_PROPERTYGET ] The member is retrieved as a property or data member.
[ DISPATCH_PROPERTYPUT ] The member is changed as a property or data member.
[ DISPATCH_PROPERTYPUTREF ] The member is changed by a reference assignment, rather than a value assignment. This flag is valid only when the property accepts a reference to an object.
vtRet:
//Specifies the type of the return value.
VT_EMPTY  void
VT_I2  short
VT_I4  long
VT_R4  float
VT_R8  double
VT_CY  CY
VT_DATE  DATE
VT_BSTR  BSTR
VT_DISPATCH  LPDISPATCH
VT_ERROR  SCODE
VT_BOOL  BOOL
VT_VARIANT VARIANT
VT_UNKNOWN  LPUNKNOWN
pvRet:
//Address of the variable that will that will receive the property value or return value. It must match the type specified by vtRet.
pbParamInfo:一般都设置为NULL
//Pointer to a null-terminated string of bytes specifying the types of the parameters following pbParamInfo.
specifies the types of the parameters passed to the method or property.
...:
//Variable List of parameters, of types specified in pbParamInfo.
VC/DirectShow技术交流群:group183839@xiaoi.com

很高兴看到你讲解InvokeHelper()函数。但是,我看过之后更郁闷了
看来,我得借本COM的书了
好想我忘说谢谢了,不好意思
谢谢!谢谢!谢谢!!!
呵呵,互相学习
VC/DirectShow技术交流群:group183839@xiaoi.com

茶,你是女的
我一直想当然的以为你是男的呢
千万不要想当然!
VC/DirectShow技术交流群:group183839@xiaoi.com

是啊是啊,以后不会了
真乖,哈哈
VC/DirectShow技术交流群:group183839@xiaoi.com


 35 1234
发新话题
查看积分策略说明

快速回复主题

选项

[完成后可按 Ctrl+Enter 发布]  预览帖子  恢复数据  清空内容