Page 4 of 6
Re: MSVS 2012
Posted:
Mon May 20, 2013 3:17 pm
by Antonio Linares
This is a very reduced codejock sample, I built it for testing. Using THActiveX makes it work fine
- Code: Select all Expand view
#include "FiveWin.ch"
static oWnd
function Main()
local oGblSettings, oBar
oGblSettings := CreateObject( "Codejock.CalendarGlobalSettings.15.0.2" )
oGblSettings:License = "Calendar Control Copyright (c) 2003-2011 Codejock Software" + CRLF + ;
"PRODUCT-ID: Codejock.Calendar.ActiveX.v15.0" + CRLF +"VALIDATE-CODE: XXX-XXX-XXX-XXX"
DEFINE WINDOW oWnd MDI
DEFINE BUTTONBAR oBar OF oWnd SIZE 50, 60 2010
DEFINE BUTTON OF oBar ACTION One()
DEFINE BUTTON OF oBar ACTION Two()
ACTIVATE WINDOW oWnd MAXIMIZED
return nil
function One()
local oWndChild, oCalex
DEFINE WINDOW oWndChild MDICHILD OF oWnd
oCalex = THActiveX():New( oWndChild, "Codejock.CalendarControl.15.0.2" )
oWndChild:oClient = oCalex
ACTIVATE WINDOW oWndChild
return nil
function Two()
local oWndChild, oCalex
DEFINE WINDOW oWndChild MDICHILD OF oWnd
oCalex = THActiveX():New( oWndChild, "Codejock.DatePicker.15.0.2" )
oWndChild:oClient = oCalex
ACTIVATE WINDOW oWndChild
return nil
Re: MSVS 2012
Posted:
Mon May 20, 2013 3:29 pm
by Richard Chidiak
Antonio
yes it could be a solution
The BuildStdDialogs() does not show , so the left part of the panel is not present but No gpf this is a very good point.
For my information, what is the difference between Tactivex and THactivex ?
i am trying to adapt the other object creation like ::OBJcalendar := TOleAuto():New( ::oCalex:oOleAuto:__hObj )
Richard
Re: MSVS 2012
Posted:
Mon May 20, 2013 3:42 pm
by Antonio Linares
Richard,
Class THActiveX is only available for Harbour. It is similar to FWH Class TActiveX, but internally is based on ATL Harbour implementation:
http://msdn.microsoft.com/en-us/library/599w5e7x(v=vs.80).aspxWe use it as an alternative to TActiveX when TActiveX (somehow) fails.
Keep your code for ::OBJcalendar := TOleAuto():New( ::oCalex:oOleAuto:__hObj ) it should work fine too
Re: MSVS 2012
Posted:
Mon May 20, 2013 3:46 pm
by Richard Chidiak
Antonio
unfortunately No
TRY
::objcalendar := nil
::oCalexStdDlgs := CreateObject( "Codejock.CalendarDialogs.15.0.2" )
::OBJcalendar := TOleAuto():New( ::oCalex:oOleAuto:__hObj )
::oCalexStdDlgs:Calendar := ::OBJcalendar
::oCalexStdDlgs:RemindersWindowShowInTaskBar = .t.
::oCalexStdDlgs:CreateRemindersWindow()
CATCH oErr
MsgInfo( "Manque composants dialogues Standard oerr " + cvaltochar(oerr))
END
we catch error , i have tried also ::oBJCALENDAR = TOleAuto():New( ::oCalex )
same we catch error
Richard
Re: MSVS 2012
Posted:
Mon May 20, 2013 3:50 pm
by Antonio Linares
Richard,
Please change this line:
::OBJcalendar := TOleAuto():New( ::oCalex:oOleAuto:__hObj )
into:
::OBJcalendar := TOleAuto():New( ::oCalex:oOle:__hObj )
Re: MSVS 2012
Posted:
Mon May 20, 2013 3:59 pm
by Richard Chidiak
Antonio
Ok for this one , no more gpf but no event is showing....
is there something to change with the dataprovider syntax ?
with object ::oCalex
:VisualTheme = ( xtpCalendarThemeOffice2007 )
:bOnEvent = { | event, aParms, pParams | ::handleEvent( Event, aParms, pParams ) }
:SetDataProvider( "Provider=custom" )
if !
ataProvider:open()
ataProvider:Create()
endif
Richard
Re: MSVS 2012
Posted:
Mon May 20, 2013 5:40 pm
by Antonio Linares
Richard,
I am doing some tests and I will email you FWH modified libs
Re: MSVS 2012
Posted:
Mon May 20, 2013 7:03 pm
by TimStone
Just a quick note.
Richard, what you sent me yesterday seems to work fine and is not showing any GPF at this time. I have applied the changes you suggested to the MSVC version.
I did test moving about the controls in the dialog and had no problem. I was also able to open and close the edit boxes repeatedly without a problem. I don't know if this is what you are having problems with, but if so, you are using the Codejock controls more aggressively than I am, so that may make a difference. I'm sticking with a single schedule and you have multiples.
Antonio, the lastest combobox code is working now. All problems that I observed were resolved.
Re: MSVS 2012
Posted:
Tue May 21, 2013 3:38 am
by Richard Chidiak
Tim
Your copy of codjock has also the problem
Dialogs that cause the crash are those called from button bar , ie printing in your case or settings
Dialogs inside the control have no problem.
The problem occurs second time you enter the dialog. To reproduce it , enter the control , call one of the dialogs from the button bar, close the control, do it again .
Richard
Re: MSVS 2012
Posted:
Tue May 21, 2013 6:32 am
by Antonio Linares
Richard,
Here it was failing even if the dialogs are not shown. Second time accessing generated the crash.
I have the events wroking with Class THActiveX, the only problem is that the events are coming as numbers, not as strings, so it requires some changes in your code.
I am working to change that and keep using strings as usual.
Re: MSVS 2012
Posted:
Tue May 21, 2013 8:20 am
by Antonio Linares
Richard,
I have just emailed you the FWH libs with changes in Class THActiveX. Events are routed now but as numbers, not as strings.
Also I have renamed DATA oOle as oOleAuto, so we are compatible with FWH Class TActiveX code.
Please run and keep open dbwin:
https://fivewin-contributions.googlecod ... bwin32.zipso you can see there the events numbers easily
Re: MSVS 2012
Posted:
Tue May 21, 2013 8:26 am
by Antonio Linares
Richard,
In fact I already got the events as strings with THActiveX too but I am not sure if it is doing it right.
Please try this:
oCalex = THActiveX():New( oWndChild, "Codejock.CalendarControl.15.0.2" )
AEVal( oCalex:aEvents, { | c | MsgInfo( c[ 1 ] ) } )
As you see, we have the names but I am not sure yet if they are the right ones.
Re: MSVS 2012
Posted:
Tue May 21, 2013 4:40 pm
by Richard Chidiak
Antonio
oCalex = THActiveX():New( oWndChild, "Codejock.CalendarControl.15.0.2" )
oCalex = THActiveX():New(::opanelcalex, "Codejock.CalendarControl.15.0.2" ) // this is for me
does not work gpf without message , did you set it for a mdichild ? , i run ocalex on a panel at main mdi window
Richard
Re: MSVS 2012
Posted:
Tue May 21, 2013 5:40 pm
by TimStone
Richard,
I have two copies of this with Codejock. One is with xHarbour ( older version ) and of course the other is with MSVC 2010.
You indicated that the controls on the button bar would gpf even on my application. I've tested it on both. I can't get it to fail. No GPF.
You specifically mentioned the printers. On mine I have the codejock implementation of views, and also my own custom report with pop up dialogs. None of these, even if repeated, can cause a GPF.
I'm wondering may have something to do with the fact your program builds multiple calendar displays within the window for different groups.
I'm just trying to help pinpoint the problem. I'm still having a combobox issue ... but that's in a different thread.
Tim
Re: MSVS 2012
Posted:
Tue May 21, 2013 6:01 pm
by Richard Chidiak
Tim
the test we use is like yours very simple , no muiltischedules. The problem is Harbour activex not the calendar. Please remove the hb_gcall() function from your tests to reproduce.
In order to make it work we added
function hb_gcAll()
return nil
This is only for testing purposes and can not remain in the software, there will be no more calls to garbage collector and some results may be unpredictable, so just for testing, your copy has this function.
It only gpf's with Harbour BCC or MSVC. This happens at second call , very easy to reproduce Antonio and i reproduced it .
At this stage , Codejock is not yet useable with Harbour, memory is not properly released and that can make a serious problem , we have to wait for the tests with Antonio to end succesfully.
There is no problem with Codejock + xharbour , it is rock solid, i have been using it very intensively since 2 years without any problem, you share the same experience, Reinaldo too.
But since we want to move to MSVC (at least i do) , we have to deal with Harbour and make sure it works 100% , hopefully we'll be there very soon.
Hth
Richard