Solved

Enum problem in ATL full control.....

Posted on 2000-03-15
8
374 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
  • 4
  • 3
8 Comments
 
LVL 5

Expert Comment

by:Wyn
Comment Utility
Try

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

0
 

Author Comment

by:Rashmin
Comment Utility
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
Comment Utility
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
 

Author Comment

by:Rashmin
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 5

Expert Comment

by:Wyn
Comment Utility
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
Comment Utility
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
Comment Utility
You have to use the following definition

typedef enum BOXTYPE
 {
  SUB, FENCE
 }BOXTYPE;

0
 

Author Comment

by:Rashmin
Comment Utility
Thanks timop. That works perfectly.
Thanks a lot again.
Rashmin
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

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…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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…

771 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

11 Experts available now in Live!

Get 1:1 Help Now