Solved

Enumerated Properties in ActiveX

Posted on 1998-06-10
1
169 Views
Last Modified: 2013-11-20
I am currently creating an ActiveX control, I would like some of the properties to display a list of options when used in Visual Basic or other Dev Environments.

i.e. When I select the property a combo box appears with the items.
0
Comment
Question by:cdm100497
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
dkremer earned 50 total points
ID: 1317832
Hi.
Add something similar to your ODL file:

      typedef [uuid(8237C324-0E9A-11d1-9583-006097B82032),
                  helpstring("ScanWizard Page Type")]
      enum {
            [helpstring("Black\\White")] swBW = 1,
            [helpstring("Greys")] swGrey = 2,
            [helpstring("Color")] swColor = 3,
      } swPageType;

      [ uuid(D18A08E5-0E72-11D1-9583-006097B82032) ]
      dispinterface IScanWiz
      {
            properties:
                  // NOTE - ClassWizard will maintain property information here.
                  //    Use extreme caution when editing this section.
                  //{{AFX_ODL_PROP(CScanWiz)
                  //}}AFX_ODL_PROP
                  [id(1)] swScanMode ScanMode;
                  [id(2)] boolean UseADF;
                  [id(3)] swScanType ScanType;
.
                  [id(8)] swPageType PageType;


.....
Be sure to generate the GUIDs for yourself with the GUID generator that comes with VC.
When your OCX will be placed in VB for example the property browser will show the values of the enumeration if that property is enumerated.

   - DKremer

0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Windows Drag & Drop Location 2 112
EvenOdd challenge 10 146
mapAB Challlenge 35 173
How do I get Window Title of all opened process? 4 37
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question