Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Enum problem in ATL full control.....

Posted on 2000-03-15
8
Medium Priority
?
381 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 200 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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

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…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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…

636 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