hi,
i think i found the Differenz
Code: Select all
#define CJ_CAL "Codejock.CalendarControl.13.x.x"
#define CJ_LIC "Calendar Control Copyright (c) 2003-2009 Codejock Software" + CHR( 13 ) + CHR( 10 ) + ;
"PRODUCT-ID: Codejock.Calendar.ActiveX.vxx.0" + CHR( 13 ) + CHR( 10 ) + ;
"VALIDATE-CODE: xxx-xxx-xxx-xxx"
#PRAGMA LIBRARY( "ASCOM10.LIB" )
PROCEDURE APPSYS
RETURN
PROCEDURE MAIN(cNo)
...
DEFAULT cNo TO "2"
nNo := VAL(cNo)
DO CASE
CASE nNo == 1
//
// will crash @ oDialog
//
oCalCon := XbpActiveXControl():new( oDlg:drawingArea,, {0,0},{aSize[1]-10,aSize[2]-30} )
oCalCon:CLSID := CJ_CAL
oCalCon:License := CJ_LIC
oCalCon:create()
CASE nNo == 2
//
// use CreateObject and :DynamicCast( ActiveXObject() )
//
oCalCon := CreateObject(CJ_CAL,,CJ_LIC)
oCalCon := oCalCon:DynamicCast( ActiveXObject() )
ENDCASE
ErrorBlock( {|e| Break(e)} )
BEGIN SEQUENCE
ohWnd := oCalCon:getProperty("hWnd")
RECOVER USING oError
MsgBox("Error hWnd()")
ErrorBlock( bSaveError )
END SEQUENCE
ErrorBlock( bSaveError )
ErrorBlock( {|e| Break(e)} )
BEGIN SEQUENCE
//
// internal Dialogs
//
oDialogs := CreateObject("Codejock.CalendarDialogs.13.x.x")
//
// works : AutomationObject:setProperty("Prop", AutomationObject )
//
// crash : AutomationObject:setProperty("Prop", XbpActiveXControl() )
//
oDialogs:Calendar := oCalCon
//
// show internal Dialog
//
oDialogs:ShowNewEvent() // might in Backgound ... use ALT-TAB
RECOVER USING oError
MsgBox("Error oDialogs()")
ErrorBlock( bSaveError )
END SEQUENCE
ErrorBlock( bSaveError )
ENDIF
IF IsMemberVar(oCalCon, "Options")
oOptions := oCalCon:Options()
oOptions:FirstDayOfTheWeek := xtpCalendarDayMonday // "XBCJCAL.CH"
ELSE
//
// only XbpActiveXControl() can ":SubClass" Property "Options"
//
// CreateObject() and AutomationObject() does not get Property
//
MsgBox("No Property Options()")
ENDIF
oDlg:show()
this Way (nNo = 2) you can show "internal" Dialog, but than no Property or Methode are found
i did other activeX with CreateObject(CJ_CAL,,CJ_LIC) / o:DynamicCast( ActiveXObject() ) which work fine ...
if both, Calendar and Dialogs, are AutomationObject() you can use :SetProperty().
you can not use a XbpActiveXControl() as Property for a AutomationObject()
Code: Select all
Super Class
AutomationObject() by CreateObject()
// using
oObj := oObj:dynamicCast( ActiveXObject() )
->
Sub Class
ActiveXObject()
// using
oObj := oObj:??? // what ... ???
->
Sub Class
XbpActiveXControl()
how do i get from ActiveXObject() to XbpActiveXControl() ???
what is the Differenz between ActiveXObject() and XbpActiveXControl() ?