FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour GET an activeX ENUM by name
Posts: 182
Joined: Tue Oct 18, 2005 10:01 AM
GET an activeX ENUM by name
Posted: Fri Jun 28, 2024 12:04 PM

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.

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: GET an activeX ENUM by name
Posted: Fri Jun 28, 2024 02:15 PM

Dear Toninho,

You may use defines for each value, in example:

define xtpCalendarDayThursday 16

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 182
Joined: Tue Oct 18, 2005 10:01 AM
Re: GET an activeX ENUM by name
Posted: Fri Jun 28, 2024 04:50 PM
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.
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: GET an activeX ENUM by name
Posted: Fri Jun 28, 2024 08:13 PM
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 (fw): Select all Collapse
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
Posts: 231
Joined: Fri Jul 20, 2012 01:49 AM
Re: GET an activeX ENUM by name
Posted: Mon Jul 08, 2024 07:26 PM
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
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: GET an activeX ENUM by name
Posted: Tue Jul 09, 2024 06:13 AM

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

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion