?
Solved

Enumerated Properties in ActiveX

Posted on 1998-06-10
1
Medium Priority
?
171 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 200 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

770 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