Page 2 of 3

Re: Harbour Ole syntax

PostPosted: Tue Jun 04, 2013 6:16 am
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  Expand view

/* 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)

Re: Harbour Ole syntax

PostPosted: Tue Jun 04, 2013 6:21 am
by Antonio Linares
Richard,

This is the small example that I meant:

viewtopic.php?p=145187#p145187

Re: Harbour Ole syntax

PostPosted: Tue Jun 04, 2013 6:58 am
by Richard Chidiak
Antonio

yes i think we can assign it

Code: Select all  Expand view

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
 

Re: Harbour Ole syntax

PostPosted: Tue Jun 04, 2013 12:12 pm
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() ) ?

Re: Harbour Ole syntax

PostPosted: Tue Jun 04, 2013 12:20 pm
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

Re: Harbour Ole syntax

PostPosted: Tue Jun 04, 2013 1:38 pm
by Antonio Linares
Richard,

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

Code: Select all  Expand view
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

Re: Harbour Ole syntax

PostPosted: Tue Jun 04, 2013 2:06 pm
by Richard Chidiak
Anonio

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

try another date

Richard

Re: Harbour Ole syntax

PostPosted: Tue Jun 04, 2013 2:18 pm
by Antonio Linares
Tested with both bcc582 and MSVC2010 :-)

Re: Harbour Ole syntax

PostPosted: Tue Jun 04, 2013 2:19 pm
by Antonio Linares
Richard,

This is working fine also :-)

oCalex:DayView:Showday( Date() + 1 )

Re: Harbour Ole syntax

PostPosted: Tue Jun 04, 2013 2:19 pm
by Antonio Linares
Could it be related with SET DATE TO ... ? :-)

Re: Harbour Ole syntax

PostPosted: Tue Jun 04, 2013 2:32 pm
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

Re: Harbour Ole syntax

PostPosted: Tue Jun 04, 2013 2:46 pm
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

Re: Harbour Ole syntax

PostPosted: Tue Jun 04, 2013 2:59 pm
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 ?

Re: Harbour Ole syntax

PostPosted: Tue Jun 04, 2013 3:03 pm
by Antonio Linares
This is also working, though sunday does not show selected:

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

Image

Re: Harbour Ole syntax

PostPosted: Tue Jun 04, 2013 3:14 pm
by Richard Chidiak
Antonio

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

Richard