Condividi tramite


BEGIN_PROP_MAP

Marks the beginning of the object's property map.

BEGIN_PROP_MAP( theClass )

Parameters

  • theClass
    [in] Specifies the class containing the property map.

Remarks

The property map stores property descriptions, property DISPIDs, property page CLSIDs, and IDispatch IIDs. Classes IPerPropertyBrowsingImpl, IPersistPropertyBagImpl, IPersistStreamInitImpl, and ISpecifyPropertyPagesImpl use the property map to retrieve and set this information.

When you create an object with the ATL Project Wizard, the wizard will create an empty property map by specifying BEGIN_PROP_MAP followed by END_PROP_MAP.

BEGIN_PROP_MAP does not save out the extent (that is, the dimensions) of a property map, because an object using a property map may not have a user interface, so it would have no extent. If the object is an ActiveX control with a user interface, it has an extent. In this case, you must specify PROP_DATA_ENTRY in your property map to supply the extent.

Example

BEGIN_PROP_MAP(CMyPropCtrl)
   PROP_DATA_ENTRY("_cx", m_sizeExtent.cx, VT_UI4)
   PROP_DATA_ENTRY("_cy", m_sizeExtent.cy, VT_UI4)
   PROP_ENTRY_TYPE("Property1", 1, CLSID_MyPropPage1, VT_BSTR)
   PROP_ENTRY_TYPE_EX("Caption", DISPID_CAPTION, CLSID_MyPropPage2, IID_IMyDual1, VT_BSTR)
   PROP_ENTRY_INTERFACE_CALLBACK("CorrectParamCallback", 0, CLSID_MyPropPage1, AllowedCLSID, VT_DISPATCH)
   PROP_ENTRY_INTERFACE_CALLBACK_EX("CorrectParamCallbackEx", 1, IID_IMyDual1, CLSID_MyPropPage2, AllowedCLSID, VT_UNKNOWN)
   PROP_PAGE(CLSID_MyPropPage3)
END_PROP_MAP()

Requirements

Header: atlcom.h

See Also

Other Resources

Property Map Macros

ATL Macros