Page 1 of 1
GET an activeX ENUM by name
Posted: Fri Jun 28, 2024 12:04 pm
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.
Re: GET an activeX ENUM by name
Posted: Fri Jun 28, 2024 2:15 pm
by Antonio Linares
Dear Toninho,
You may use defines for each value, in example:
#define xtpCalendarDayThursday 16
Re: GET an activeX ENUM by name
Posted: Fri Jun 28, 2024 4:50 pm
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
Regards.
Re: GET an activeX ENUM by name
Posted: Fri Jun 28, 2024 8:13 pm
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
Re: GET an activeX ENUM by name
Posted: Mon Jul 08, 2024 7:26 pm
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.
Re: GET an activeX ENUM by name
Posted: Tue Jul 09, 2024 6:13 am
by Antonio Linares
Just do a binary search inside the ActiveX DLL for xtpCalendarDayThursday and check if it is there