Click here to Skip to main content
13,145,464 members (49,407 online)
Click here to Skip to main content
Add your own
alternative version


41 bookmarked
Posted 2 Jun 2000

Setting Properties with OLE Automation

, 5 Aug 2000
Rate this:
Please Sign up or sign in to vote.
Describes an ActiveX Control to use OLE Automation to set an object's properties.
  • Download demo project - 113 Kb
  • Download source files - 114 Kb
  • Sample Image - PropertySetCtl.jpg

    Table of Contents.

    1. Introduction
    2. How it works
    3. Control interface
    4. Source interface
    5. User interface
    6. Environment
    7. Acknowledgement, References
    8. Some words about VB demo


    kPropertySet.kObserver - This ActiveX control provides a way for presenting and editing of the set of properties (Visual Basic IDE - like property browser).

    The main features are:

    1. Editing a set of properties through the IDispatch interface.
    2. Works with IPerPropertyBrowsing and ICategorizeProperties interfaces
    3. Supports any type of property compatible with OLE automation
    4. Supports user-defined types
    5. Sorting for alphabet and categories
    6. Flexible customization
    7. Small size: 73.5 KB in release min size configuration

    How it works

    After receiving the pointer from the IDispatch interface, the control explores the type library. For each property with attribute "propget" there is an object implementing the logic of visualization, data exchange and data validation. The properties with attributes "hidden", "nonbrowsable", and "restricted" are skipped.

    Control interface

    The following is a description of the kObserver interface:

    Property Dispatch:
    External dispatch interface.

    Property Font:
    Current font.

    Property BackColor:
    Back color of list view window.

    Property ForeColor:
    Foreground color used for display text.

    Property GridColor:
    Color used for display grid.

    Property HighliteBackColor:
    Color used for display selected item.

    Property HighliteForeColor:
    Color used for display text of selected item.

    Property EditBackColor:
    Background color used for display edit window.

    Property EditForeColor:
    Foreground color used for display text in edit window.

    Property SignColor:
    The sign color.

    Property EnableContextMenu:
    Must be false if show of the context menu is unnecessary.

    Property Categorized:
    Sort mode, true if sorting by categories.

    Property LineSpacing:
    Additional spacing between rows can be negative.

    Property exStyleEdit:
    Extended window style of edit window.

    Property SelectName:
    Name of active property.

    Property SelectDesc:
    Description of active property.

    Property SelectValue:
    Value of active property.

    Property SelectDispid:
    DISPID of active property.

    Source interface

    Method OnChangeSelect:
    Occurs when user changes the active property.

    User interface

    Keyboard keys:

    • F5: refresh
    • F2, tab: edit property (if possible)
    • Space: simulate right button click

    Context Menu:

    • Alphabetic \ Categorized: select sort mode
    • Restore \ Customize Self: edit self property or external
    • Refresh: repaint and reload property value


    This component was created with VC 6.0. (SP3) and ATL. It has been tested on Windows 2000 and Windows 98. Requires: Windows 98, Windows NT 4.0, Windows 2000, and Interned Explorer 4.

    Acknowledgement, References

    The following source code was used in writing this ActiveX control:

    Thanks them once more.

    Some words about VB demo

    For persisting \ restoreing the property in VB runtime I write the kPersistMngs.kStorageMng component. It's a simple wrapper to work with compound files in VB.


    • 6 Aug 2000 - updated to version 1.2 and fixes bugs detected by Robert Rolls


    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here


    About the Author

    Konstantin Boukreev
    Web Developer
    Russian Federation Russian Federation
    I am freelance programmer. About 3 years of experience in C++ and I would rather use ATL, STL, WTL but not MFC Smile | :) . Main backgrounds are Win32 API, COM and Networking. Now I am interested about AI (Neural Network, Fuzzy Logic and GA). Currently based in Vladivostok, Russia.

    You may also be interested in...

    Comments and Discussions

    Generalmultiple IDispatch Pin
    third19-Dec-01 4:57
    memberthird19-Dec-01 4:57 
    GeneralRe: multiple IDispatch Pin
    Konstantin Boukreev19-Dec-01 15:12
    memberKonstantin Boukreev19-Dec-01 15:12 

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

    Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

    Permalink | Advertise | Privacy | Terms of Use | Mobile
    Web04 | 2.8.170915.1 | Last Updated 6 Aug 2000
    Article Copyright 2000 by Konstantin Boukreev
    Everything else Copyright © CodeProject, 1999-2017
    Layout: fixed | fluid