Link to home
Start Free TrialLog in
Avatar of Rashmin
Rashmin

asked on

Enum problem in ATL full control.....

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



Avatar of Wyn
Wyn

Try

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

Avatar of Rashmin

ASKER

Hi Wyn
I tried the above thing but it does not help. VB is still showing random values for the enum type properties.
Rashmin
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:)
Avatar of Rashmin

ASKER

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?
Maybe the data type/int,byte.. is the reason.VB take it as int but maybe it's byte long.

Avatar of Rashmin

ASKER

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
ASKER CERTIFIED SOLUTION
Avatar of timop
timop

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rashmin

ASKER

Thanks timop. That works perfectly.
Thanks a lot again.
Rashmin