The information in this article applies to:
This is the 32-bit version of this sample. SUMMARY
The ENPROP32 sample illustrates using enumerated properties in an OLE
control.
~ Enprop32.exeFor more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base: Q119591 How to Obtain Microsoft Support Files from Online Services MORE INFORMATION
The ENPROP32 sample illustrates using enumerated properties in an OLE
control. An enumerated property is one which has a specific set
of possible values. For example, an OLE control might support a
property named FillPattern which it uses to determine the type of brush
to use when drawing the control. The control would want to limit the
values the FillPattern property could be set to. Accepted values for a
FillPattern property might be cross-hatched, vertical lines, horizontal
lines, etc.
Another method involves overriding the COleControl methods
OnGetPredefinedStrings, OnGetPredefinedValue, and OnGetDisplayString.
The ENUMPROP sample illustrates using both methods. The OLE control
implemented in the sample supports two custom properties, LineStyle
and FillPattern. The LineStyle property is declared as an enum in the
control's .odl file. Support for using the FillPattern property as an
enumerated property is handled via overrides of the
OnGetPredefinedStrings, OnGetPredefinedValue, and OnGetDisplayString
methods.
ENPROP32 is based on a ControlWizard generated OLE control. Files included with the sample, which are directly related to using enumerated properties, are: ENUM.ODL - RFERENCESThe Per-Property Browsing section in Appendix D, OLE Controls Architecture, in the CDK Books Online. NOTE: The OLE Control Test Container provided with Visual C++ does not implement a Drop List combobox on its property browser page when editing an enumerated property. To see the full benefits of using an enumerated property, use an OLE control container application which provides a property browser with this capability, such as Visual Basic 4.0. Additional query words: Enumprop
Keywords : kbcode kbole kbsample kbMFC kbVC |
Last Reviewed: August 3, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |