标题:代码的意义
只看楼主
jgh37
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2006-4-8
 问题点数:0 回复次数:1 
代码的意义
大家看看这段代码的意义.InvokeHelper这个函数是怎么用的
void CMSComm::SetOutput(const VARIANT& newValue)
{
static BYTE parms[] =
VTS_VARIANT;
InvokeHelper(0x19, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
&newValue);
}
搜索更多相关主题的帖子: 代码 
2006-04-08 12:03
程序风波
Rank: 1
等 级:新手上路
帖 子:35
专家分:0
注 册:2006-4-2
得分:0 
可以看看下面这个:
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

2006-04-08 14:43



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-56015-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.065763 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved