Solved

Enumerated Properties in ActiveX

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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 video discusses moving either the default database or any database to a new volume.

762 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

20 Experts available now in Live!

Get 1:1 Help Now