다음을 통해 공유


DISP_PROPERTY_PARAM

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

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

매개 변수

  • 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.

설명

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.

예제

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:

SHORT GetArray(SHORT row, SHORT column);
void SetArray(SHORT row, SHORT column, SHORT newVal);

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

DISP_PROPERTY_PARAM(CMFCActiveXControlCtrl, "Array", GetArray, SetArray, VT_I2, VTS_I2 VTS_I2 )

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

IDispatch* GetItem(SHORT index1, SHORT index2, SHORT index3);
void SetItem(SHORT index1, SHORT index2, SHORT index3, IDispatch* pVal);

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

DISP_PROPERTY_PARAM(CMFCActiveXControlCtrl, "Item", GetItem, SetItem, VT_DISPATCH, VTS_I2 VTS_I2 VTS_I2)

요구 사항

헤더: afxdisp.h

참고 항목

참조

DISP_PROPERTY_EX

개념

MFC 매크로 및 전역

기타 리소스

디스패치 맵