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
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
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 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:)
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?
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks timop. That works perfectly.
Thanks a lot again.
Rashmin
Thanks a lot again.
Rashmin
typedef enum
{
SUB=0, FENCE=1
}BOXTYPE;