Harbour Ole syntax

Re: Harbour Ole syntax

Postby Antonio Linares » Tue Jun 04, 2013 6:16 am

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)
regards, saludos

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

Re: Harbour Ole syntax

Postby Antonio Linares » Tue Jun 04, 2013 6:21 am

Richard,

This is the small example that I meant:

viewtopic.php?p=145187#p145187
regards, saludos

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

Re: Harbour Ole syntax

Postby Richard Chidiak » Tue Jun 04, 2013 6:58 am

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
 
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

Re: Harbour Ole syntax

Postby nageswaragunupudi » Tue Jun 04, 2013 12:12 pm

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
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Harbour Ole syntax

Postby Richard Chidiak » Tue Jun 04, 2013 12:20 pm

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
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Re: Harbour Ole syntax

Postby Antonio Linares » Tue Jun 04, 2013 1:38 pm

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
regards, saludos

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

Re: Harbour Ole syntax

Postby Richard Chidiak » Tue Jun 04, 2013 2:06 pm

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
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Re: Harbour Ole syntax

Postby Antonio Linares » Tue Jun 04, 2013 2:18 pm

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

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

Re: Harbour Ole syntax

Postby Antonio Linares » Tue Jun 04, 2013 2:19 pm

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: 42092
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Harbour Ole syntax

Postby Antonio Linares » Tue Jun 04, 2013 2:19 pm

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

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

Re: Harbour Ole syntax

Postby Richard Chidiak » Tue Jun 04, 2013 2:32 pm

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

Re: Harbour Ole syntax

Postby Richard Chidiak » Tue Jun 04, 2013 2:46 pm

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
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Re: Harbour Ole syntax

Postby Antonio Linares » Tue Jun 04, 2013 2:59 pm

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: 42092
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Harbour Ole syntax

Postby Antonio Linares » Tue Jun 04, 2013 3:03 pm

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
Antonio Linares
Site Admin
 
Posts: 42092
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Harbour Ole syntax

Postby Richard Chidiak » Tue Jun 04, 2013 3:14 pm

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
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 106 guests