Page 1 of 3
Harbour Ole syntax
Posted:
Mon Jun 03, 2013 2:22 pm
by Richard Chidiak
Hello
I have a problem with Ole syntax concerning Harbour
with xharbour the syntax is
ayView:Showday(::TPAR[04])
This works ok, with Harbour , compile Ok but the action is not fired
i have tried
ayView:Showday = ::TPAR[04] but i get an error (ole error)
really puzzling how Harbour interacts with ole syntax...
as an example
:ViewType = PLANPREF->VUEDEBUT this is OK in harbour the above should in theory be the same .....
:TimeLineView:BackgroundColor = ( RGB(176, 216, 255) ) works ok also
Antonio any idea ?
Thanks
Richard
Re: Harbour Ole syntax
Posted:
Mon Jun 03, 2013 3:21 pm
by Antonio Linares
Richard,
The Harbour OLE implementation invokes different code in these cases:
oDayView:Showday(::TPAR[04]) // this invokes a method
oDayView:Showday = ::TPAR[04] but i get an error (ole error) // This assign a data
So first of all we need to know it is is a data or a method. Whats the ProgId of this activex ? Once you tell me, I can inspect it here using the utility that I recently published here.
Re: Harbour Ole syntax
Posted:
Mon Jun 03, 2013 4:03 pm
by Richard Chidiak
Antonio
it is not a method
it is a property (data)
Richard
Re: Harbour Ole syntax
Posted:
Mon Jun 03, 2013 4:15 pm
by Antonio Linares
Richard,
Then you should use:
oDayView:Showday = ::TPAR[04] but i get an error (ole error)
what Ole error you get ?
Re: Harbour Ole syntax
Posted:
Mon Jun 03, 2013 4:19 pm
by Richard Chidiak
This is the error
Error description: (DOS Error -2147352571) WINOLE/1006 Argument error: _SHOWDAY
Args:
[ 1] = D 03/06/2013
Stack Calls
===========
Called from: => WIN_OLEAUTO:_SHOWDAY( 0 )
Richard
Re: Harbour Ole syntax
Posted:
Mon Jun 03, 2013 6:19 pm
by Antonio Linares
What type of argument does it expect ?
Re: Harbour Ole syntax
Posted:
Mon Jun 03, 2013 6:31 pm
by Richard Chidiak
2 arguments
first one date and the second boolean (default to set)
Public Sub ShowDay( _
ByVal Day As Date, _
Optional ByVal Select As Boolean = True _
)
Parameters
Day
[in] Date\DteTime object specifying the date to show in the current view.
Select
[in] True to select\highlight the date after showing the date. False to ow the date, but not select it.
Remarks
Example
[ShowDay Sample (Visual Basic)] This sample illustrates how to show a date it both day view and month view.
Dim d As Date
d = #10/10/2004#
'Show a date in Day view
CalendarControl.DayView.ShowDay d, True
'Show a date in Month View
CalendarControl.ViewType = xtpCalendarMonthView
CalendarControl.MonthView.ShowDay d, False
Re: Harbour Ole syntax
Posted:
Mon Jun 03, 2013 8:32 pm
by Antonio Linares
Richard,
Have you tried it this way ?
oDayView:Showday( ::TPAR[ 04 ], .F. )
Re: Harbour Ole syntax
Posted:
Mon Jun 03, 2013 8:38 pm
by Richard Chidiak
Antonio
oDayView:Showday( ::TPAR[ 04 ], .F. )
oDayView:Showday( ::TPAR[ 04 ], .t. )
Both have no effect as if they were completely ignored
Richard
Re: Harbour Ole syntax
Posted:
Tue Jun 04, 2013 2:03 am
by James Bott
Richard,
Parameters
Day
[in] Date\DteTime object specifying the date to show in the current view.
This says it is an object, not a date format. Can you find any info on a Date/time object?
James
Re: Harbour Ole syntax
Posted:
Tue Jun 04, 2013 5:24 am
by nageswaragunupudi
Does this work?
oDayView:ShowDay( '#2013-10-10#' )
Note:
'#' + Transform( SToD( dDate ), "@R 9999-99-99" ) + '#' --> converts date to format accepted in ado / odbc
Re: Harbour Ole syntax
Posted:
Tue Jun 04, 2013 5:32 am
by Richard Chidiak
unfortunately no
it definitely is expectig a "date format" , here we send a character string
Error description: (DOS Error -2147352571) WINOLE/1007 Argument error: SHOWDAY
Args:
[ 1] = C #2013-10-10#
Re: Harbour Ole syntax
Posted:
Tue Jun 04, 2013 5:34 am
by Richard Chidiak
James
I have tried to set it as a date/time but no result
TTOS((STOT(DTOS(::TPAR[04]) + ::TPAR[03])) does not work
Richard
Re: Harbour Ole syntax
Posted:
Tue Jun 04, 2013 5:42 am
by nageswaragunupudi
May I ask, if this is working with xHarbour ?
Re: Harbour Ole syntax
Posted:
Tue Jun 04, 2013 5:47 am
by Richard Chidiak
yes working perfect with xharbour
ayView:Showday(::TPAR[04]) tpar[04] is a date format