Solved

Enumerated Properties in ActiveX

Posted on 1998-06-10
1
163 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Powershell based monitoring system 2 137
Separate files macro - Errors on larger data set 18 65
maxBlock challenge 30 111
zeroFront challenge 7 79
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

948 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now