Solved

Enum problem in ATL full control.....

Posted on 2000-03-15
8
378 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
Industry Leaders: 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!

 

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…

688 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