GET an activeX ENUM by name

Post Reply
toninhofwi
Posts: 172
Joined: Tue Oct 18, 2005 10:01 am

GET an activeX ENUM by name

Post by toninhofwi »

Hi friends,

Is there a way to get an active enum value by its name:

For example: I need get "xtpCalendarDayThursday" value to use in activeX object:

type
CalendarWeekDay = TOleEnum;
const
xtpCalendarDaySunday = 1;
xtpCalendarDayMonday = 2;
xtpCalendarDayTuesday = 4;
xtpCalendarDayWednesday = 8;
xtpCalendarDayThursday = 16;
xtpCalendarDayFriday = 32;
xtpCalendarDaySaturday = 64;
xtpCalendarDayAllWeek = 127;
xtpCalendarDaySaSu = 65;
xtpCalendarDayMo_Fr = 62;


Thanks and best regards.
User avatar
Antonio Linares
Site Admin
Posts: 42393
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 9 times
Been thanked: 41 times
Contact:

Re: GET an activeX ENUM by name

Post by Antonio Linares »

Dear Toninho,

You may use defines for each value, in example:

#define xtpCalendarDayThursday 16
regards, saludos

Antonio Linares
www.fivetechsoft.com
toninhofwi
Posts: 172
Joined: Tue Oct 18, 2005 10:01 am

Re: GET an activeX ENUM by name

Post by toninhofwi »

Antonio Linares wrote:Dear Toninho,
You may use defines for each value, in example:
#define xtpCalendarDayThursday 16
Hi Antonio, Thanks for the answer.

I'm doing this, but it would be easier to get the value directly from the object.

BTW thank you :D

Regards.
User avatar
Jimmy
Posts: 1734
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: GET an activeX ENUM by name

Post by Jimmy »

toninhofwi wrote:Is there a way to get an active enum value by its name:
For example: I need get "xtpCalendarDayThursday" value to use in activeX object:
type
CalendarWeekDay = TOleEnum;
you need to compare Result from Enum with Calendar define Constant

Code: Select all | Expand

Result_Value := TOleEnum;
Do CASE
   CASE xtpCalendarDaySunday = Result_Value
? "Sunday"
   CASE xtpCalendarDayMonday = Result_Value
? "Monday"
   CASE xtpCalendarDayTuesday = Result_Value
? "Tuesday"
   CASE xtpCalendarDayWednesday = Result_Value
? "Wednesday"
   CASE xtpCalendarDayThursday = Result_Value
? "Thursday"
   CASE xtpCalendarDayFriday = Result_Value
? "Friday"
   CASE xtpCalendarDaySaturday = Result_Value
? "Saturday"
   CASE xtpCalendarDayAllWeek = Result_Value
? "AllWeek"
   CASE xtpCalendarDaySaSu = Result_Value
? "SaSu"
   CASE xtpCalendarDayMo_Fr = Result_Value
? "Mo_Fr"
ENDCASE
greeting,
Jimmy
User avatar
Lailton
Posts: 160
Joined: Fri Jul 20, 2012 1:49 am
Location: Brazil
Contact:

Re: GET an activeX ENUM by name

Post by Lailton »

Hi my friend toninhofwi,

It is something that I had in mind to verify too.
I will be checking about it and if I discover something I will share here.

:D
Regards,
Lailton Fernando Mariano
User avatar
Antonio Linares
Site Admin
Posts: 42393
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 9 times
Been thanked: 41 times
Contact:

Re: GET an activeX ENUM by name

Post by Antonio Linares »

Just do a binary search inside the ActiveX DLL for xtpCalendarDayThursday and check if it is there
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply