Harbour Ole syntax

User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Harbour Ole syntax

Post by Antonio Linares »

James, Richard,

Harbour OLE converts a Harbour date into a Variant Date automatically, in Harbour/contrib/hbwin/olecore.c there is:

Code: Select all

/* Item <-> Variant conversion */

static void hb_oleItemToVariantRef( VARIANT * pVariant, PHB_ITEM pItem,
                                    VARIANT * pVarRef, HB_OLEOBJ_FUNC pObjFunc 
...
      case HB_IT_DATE:
         V_VT( pVariant ) = VT_DATE;
         V_R8( pVariant ) = ( double ) ( hb_itemGetDL( pItem ) - HB_OLE_DATE_BASE );
         if( pVarRef )
         {
            V_VT( pVarRef ) = VT_DATE | VT_BYREF;
            V_R8REF( pVarRef ) = &V_R8( pVariant );
         }
         break;
 
So if we place a trace there, we could check the conversion. i.e. MessageBox( 0, "date to ole_date", "ok", 0 ); after VT_DATE assignment.

Richard, remember the small example that I posted here ? can I assign this property from it ? thanks (so I check the assignment here)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Harbour Ole syntax

Post by Antonio Linares »

Richard,

This is the small example that I meant:

http://forums.fivetechsupport.com/viewt ... 87#p145187
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Richard Chidiak
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France
Contact:

Re: Harbour Ole syntax

Post by Richard Chidiak »

Antonio

yes i think we can assign it

Code: Select all

DEFINE WINDOW oWndChild MDICHILD OF oWnd
   
   oCalex = THActiveX():New( oWndChild, "Codejock.CalendarControl.15.0.2" )

ocalex:ViewType = 0  // day view
ocalex:DayView:Showday(xxxxx)    <----  
   
   oWndChild:oClient = oCalex
   
   ACTIVATE WINDOW oWndChild
 
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Harbour Ole syntax

Post by nageswaragunupudi »

Richard Chidiak wrote:yes working perfect with xharbour

:DayView:Showday(::TPAR[04]) tpar[04] is a date format
That means :DayView:ShowDay( dDate ), is working correctly in xHarbour but not in Harbour.

Sorry to keep asking you, but may I ask
- Is passing date parameters in other methods of codejock are giving similar problems or only the ShowDay() method?
- Does passing the value as DateTime value ( valtype 'T' ) solve the issue? Example :DayView:ShowDay( HB_DateTime() ) ?
Regards

G. N. Rao.
Hyderabad, India
User avatar
Richard Chidiak
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France
Contact:

Re: Harbour Ole syntax

Post by Richard Chidiak »

That means :DayView:ShowDay( dDate ), is working correctly in xHarbour but not in Harbour.

yes working correct with xharbour but not harbour

- Is passing date parameters in other methods of codejock are giving similar problems or only the ShowDay() method?

All other passing parameters have been fixed , this is the only one

- Does passing the value as DateTime value ( valtype 'T' ) solve the issue? Example :DayView:ShowDay( HB_DateTime() ) ?[/quote]

No i tried a date/time value TTOS((STOT(DTOS(::TPAR[04]) + ::TPAR[03])) but it gave an error , i have not tried hb_datetime() , i can do it
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Harbour Ole syntax

Post by Antonio Linares »

Richard,

My example with your two lines of code is working correct! :-)

Code: Select all

function One()

   local oWndChild, oCalex
   
   DEFINE WINDOW oWndChild MDICHILD OF oWnd
   
   oCalex = THActiveX():New( oWndChild, "Codejock.CalendarControl.15.0.2" )
 
   oCalex:ViewType = 0  // day view
   oCalex:DayView:Showday( Date() )       
   
   oWndChild:oClient = oCalex
   
   ACTIVATE WINDOW oWndChild
  
return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Richard Chidiak
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France
Contact:

Re: Harbour Ole syntax

Post by Richard Chidiak »

Anonio

Date() is the default codejock starts at "today"

try another date

Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Harbour Ole syntax

Post by Antonio Linares »

Tested with both bcc582 and MSVC2010 :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Harbour Ole syntax

Post by Antonio Linares »

Richard,

This is working fine also :-)

oCalex:DayView:Showday( Date() + 1 )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Harbour Ole syntax

Post by Antonio Linares »

Could it be related with SET DATE TO ... ? :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Richard Chidiak
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France
Contact:

Re: Harbour Ole syntax

Post by Richard Chidiak »

Antonio

:DayView:Showday(DATE() + 5) or whatever parameter only the current day is shown in all views

i do not think it is related to set date

i manipulate a lot of datas with dates in codejock , all events are retreived with dates, appointments, schedules etc.... no problem on these

very strange
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France
Contact:

Re: Harbour Ole syntax

Post by Richard Chidiak »

Antonio

Ok i go,t it working for dayview and monthview

for Harbour the :DayView:Showday(::TPAR[04]) has to be the very last directive , it works in this case for dayview and monthview but not for weekview, still searching but i can handle this

with Xharbour it is straight, no matter where the directive is... much more powerful and flexible.

thank you for your time.

Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Harbour Ole syntax

Post by Antonio Linares »

Richard,

If I use:

oCalex:ViewType = 0 // day view
oCalex:DayView:Showday( Date() + 5 )

then I see this:

Image

whats wrong there ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Harbour Ole syntax

Post by Antonio Linares »

This is also working, though sunday does not show selected:

oCalex:DayView:Showday( Date() + 5 )
oCalex:ViewType = 2

Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Richard Chidiak
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France
Contact:

Re: Harbour Ole syntax

Post by Richard Chidiak »

Antonio

oCalex:DayView:Showday( Date() + 50 ) // +5 you are in the same week
oCalex:ViewType = 2

Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
Post Reply