Solved

Enum problem in ATL full control.....

Posted on 2000-03-15
8
377 Views
Last Modified: 2013-11-25
Hi
I have got a problem with ATL full control.
I have defined some enums in IDL and have some properties added to the
control of the enum type

for e.g.

 typedef enum
 {
  SUB, FENCE
 }BOXTYPE;

is defined as enum in library section of idl and 'boxType' is a property
added of type BOXTYPE to the control.

Now the problem is that in VB when the control is added to the form, in the
properties box ( accessed through F4), random values are shown for the
properties of these enum types.
Hence in the properties box, for the above boxType property some random
value such as 5864856- is shown instead of the values 0 / 1 or SUB / FENCE.

What is to be done in such a case?

I have also checked the .tlb through the OLE viewer and found that the definitions of the enums are perfect.

Thanx in advance
Rashmin



0
Comment
Question by:Rashmin
[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
  • 4
  • 3
8 Comments
 
LVL 5

Expert Comment

by:Wyn
ID: 2620219
Try

 typedef enum
 {
  SUB=0, FENCE=1
 }BOXTYPE;

0
 

Author Comment

by:Rashmin
ID: 2622233
Hi Wyn
I tried the above thing but it does not help. VB is still showing random values for the enum type properties.
Rashmin
0
 
LVL 5

Expert Comment

by:Wyn
ID: 2622583
I dont know why.I think the sub and fence has been replaced by 0 and 1 at compiling time.It should work.I figure it's problem of VB'S:)
0
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 

Author Comment

by:Rashmin
ID: 2622646
I've even checked the enum entries in the .tlb and values 0 and 1 are shown there but in VB it is always showing the value 5864856-. Moreover, it is not allowing to edit this value.
Please let me know what else can be done?
0
 
LVL 5

Expert Comment

by:Wyn
ID: 2622699
Maybe the data type/int,byte.. is the reason.VB take it as int but maybe it's byte long.

0
 

Author Comment

by:Rashmin
ID: 2622968
yes it is true that if i make it long VB accepts it but then i cannot show the actual enum values in the properties box
0
 
LVL 1

Accepted Solution

by:
timop earned 50 total points
ID: 2633031
You have to use the following definition

typedef enum BOXTYPE
 {
  SUB, FENCE
 }BOXTYPE;

0
 

Author Comment

by:Rashmin
ID: 2639761
Thanks timop. That works perfectly.
Thanks a lot again.
Rashmin
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ShiftLeft challenge 21 95
Post a good COM tutorial 1 72
PL SQL Developer 7 90
Please explain the parts of these 2 LINQ expressions 3 102
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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 Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

734 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