This documentation is archived and is not being maintained.

DISP_PROPERTY_PARAM

Defines a property accessed with separate Get and Set member functions.

DISP_PROPERTY_NOTIFY(theClass, pszExternalName, pfnGet, pfnSet, vtPropType, vtsParams )

Parameters

theClass
Name of the class.
pszExternalName
External name of the property.
pfnGet
Name of the member function used to get the property.
pfnSet
Name of the member function used to set the property.
vtPropType
A value specifying the property's type.
vtsParams
A string of space-separated VTS_ variant parameter types, one for each parameter.

Remarks

Unlike the DISP_PROPERTY_EX macro, this macro allows you to specify a parameter list for the property. This is useful for implementing properties that are indexed or parameterized.

Example

Consider the following declaration of get and set member functions that allow the user to request a specific row and column when accessing the property:

afx_msg short GetArray( short row, short column );
afx_msg short SetArray( short row, short column, short nNewValue );

These correspond to the following DISP_PROPERTY_PARAM macro in the control dispatch map:

DISP_PROPERTY_PARAM( CMyCtrl, "Array", GetArray, SetArray, VT-I2, VTS_I2 VTS_I2 )

As another example, consider the following get and set member functions:

LPDISPATCH CMyObject::GetItem( short index1, short index2, short index3 );
void CMyObject::SetItem( short index1, short index2, short index3, LPDISPATCH newValue );

These correspond to the following DISP_PROPERTY_PARAM macro in the control dispatch map:

DISP_PROPERTY_PARAM( CMyObject, "item", GetItem, SetItem, VT_DISPATCH, 
   VTS_I2 VTS_I2 VTS_I2 )

Requirements

Header: afxdisp.h

See Also

MFC Macros and Globals | Dispatch Maps | DISP_PROPERTY_EX

Show: