Solved

Enumerated Properties in ActiveX

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB.NET how to use the Vertical ScrollBar 5 103
isEverywhere  challenge 19 78
noX challenge 17 119
How to convert MFC::CString to UTF8 wchar_t* 10 212
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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…
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 shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

803 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