description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Learn more about: Property Map Macros |
Property Map Macros |
11/04/2016 |
|
|
128bc742-2b98-4b97-a243-684dbb83db77 |
These macros define property maps and entries.
Name | Description |
---|---|
BEGIN_PROP_MAP | Marks the beginning of the ATL property map. |
PROP_DATA_ENTRY | Indicates the extent, or dimensions, of an ActiveX control. |
PROP_ENTRY_TYPE | Enters a property description, property DISPID, and property page CLSID into the property map. |
PROP_ENTRY_TYPE_EX | Enters a property description, property DISPID, property page CLSID, and IDispatch IID into the property map. |
PROP_PAGE | Enters a property page CLSID into the property map. |
END_PROP_MAP | Marks the end of the ATL property map. |
Header: atlcom.h
Marks the beginning of the object's property map.
BEGIN_PROP_MAP(theClass)
theClass
[in] Specifies the class containing the property map.
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.
[!code-cppNVC_ATL_Windowing#103]
Indicates the extent, or dimensions, of an ActiveX control.
PROP_DATA_ENTRY( szDesc, member, vt)
szDesc
[in] The property description.
member
[in] The data member containing the extent; for example, m_sizeExtent
.
vt
[in] Specifies the VARIANT type of the property.
This macro causes the specified data member to be persisted.
When you create an ActiveX control, the wizard inserts this macro after the property map macro BEGIN_PROP_MAP and before the property map macro END_PROP_MAP.
In the following example, the extent of the object (m_sizeExtent
) is being persisted.
[!code-cppNVC_ATL_Windowing#131] [!code-cppNVC_ATL_Windowing#132]
Use this macro to enter a property description, property DISPID, and property page CLSID into the object's property map.
PROP_ENTRY_TYPE( szDesc, dispid, clsid, vt)
szDesc
[in] The property description.
dispid
[in] The property's DISPID.
clsid
[in] The CLSID of the associated property page. Use the special value CLSID_NULL for a property that does not have an associated property page.
vt
[in] The property's type.
The PROP_ENTRY macro was insecure and deprecated. It has been replaced with PROP_ENTRY_TYPE.
The BEGIN_PROP_MAP macro marks the beginning of the property map; the END_PROP_MAP macro marks the end.
See the example for BEGIN_PROP_MAP.
Similar to PROP_ENTRY_TYPE, but allows you specify a particular IID if your object supports multiple dual interfaces.
PROP_ENTRY_TYPE_EX( szDesc, dispid, clsid, iidDispatch, vt)
szDesc
[in] The property description.
dispid
[in] The property's DISPID.
clsid
[in] The CLSID of the associated property page. Use the special value CLSID_NULL for a property that does not have an associated property page.
iidDispatch
[in] The IID of the dual interface defining the property.
vt
[in] The property's type.
The PROP_ENTRY_EX macro was insecure and deprecated. It has been replaced with PROP_ENTRY_TYPE_EX.
The BEGIN_PROP_MAP macro marks the beginning of the property map; the END_PROP_MAP macro marks the end.
The following example groups entries for IMyDual1
followed by an entry for IMyDual2
. Grouping by dual interface will improve performance.
[!code-cppNVC_ATL_Windowing#133]
Use this macro to enter a property page CLSID into the object's property map.
PROP_PAGE(clsid)
clsid
[in] The CLSID of a property page.
PROP_PAGE is similar to PROP_ENTRY_TYPE, but does not require a property description or DISPID.
Note
If you have already entered a CLSID with PROP_ENTRY_TYPE or PROP_ENTRY_TYPE_EX, you do not need to make an additional entry with PROP_PAGE.
The BEGIN_PROP_MAP macro marks the beginning of the property map; the END_PROP_MAP macro marks the end.
[!code-cppNVC_ATL_Windowing#134]
Marks the end of the object's property map.
END_PROP_MAP()
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.
See the example for BEGIN_PROP_MAP.