2009-10-21 17:09 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)

+ contrib/hbwin/tests/testax.prg
    + Added self-contained AX example created by Alex Strickland.
      (plus some formatting and warning fix)

  * contrib/hbwin/axfunc.prg
    + Added <cID> parameter to WIN_AxGetControl().
      Please review it.
This commit is contained in:
Viktor Szakats
2009-10-21 15:10:06 +00:00
parent 61f278a65b
commit 2071207236
3 changed files with 64 additions and 2 deletions

View File

@@ -17,6 +17,15 @@
past entries belonging to author(s): Viktor Szakats.
*/
2009-10-21 17:09 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
+ contrib/hbwin/tests/testax.prg
+ Added self-contained AX example created by Alex Strickland.
(plus some formatting and warning fix)
* contrib/hbwin/axfunc.prg
+ Added <cID> parameter to WIN_AxGetControl().
Please review it.
2009-10-21 13:46 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/src/rtl/hbini.prg
! fixed stripping last character when the last line in ini file

View File

@@ -50,12 +50,12 @@
*
*/
FUNCTION WIN_AxGetControl( hWnd, bHandler )
FUNCTION WIN_AxGetControl( hWnd, bHandler, cID )
LOCAL oAx := WIN_OleAuto()
oAx:__hObj := __AxGetControl( hWnd )
IF bHandler != NIL
oAx:__hSink := __AxRegisterHandler( oAx:__hObj, bHandler )
oAx:__hSink := __AxRegisterHandler( oAx:__hObj, bHandler, cID )
ENDIF
RETURN oAx

View File

@@ -0,0 +1,53 @@
/*
* $Id$
*/
#include "hbgtinfo.ch"
#include "hbclass.ch"
REQUEST HB_GT_WVT_DEFAULT
#define WS_CHILD 1073741824
#define WS_VISIBLE 268435456
#define WS_CLIPCHILDREN 33554432
PROCEDURE Main()
LOCAL oMSCAL
WAIT "Make sure we are 'Active Window'"
oMSCAL := HActiveX():Init( WAPI_GetActiveWindow(), "MSCAL.Calendar", 0, 0, 300, 300 )
WAIT "Press any key to exit"
oMSCAL:Close()
RETURN
CLASS HActiveX
DATA oOLE
METHOD Init
METHOD Event
ERROR HANDLER OnError
// DESTRUCTOR Close
METHOD Close
ENDCLASS
METHOD Init( hWnd, cProgId, nTop, nLeft, nWidth, nHeight, cID ) CLASS HActiveX
LOCAL nStyle := WS_CHILD + WS_VISIBLE + WS_CLIPCHILDREN
win_AxInit()
hWnd := WAPI_CreateWindowEX( 0, "AtlAxWin", cProgId, nStyle, nLeft, nTop, nWidth, nHeight, hWnd, 0 )
::oOLE := WIN_AxGetControl( hWnd, { | event, ... | ::Event( event, ... ) }, cID )
RETURN self
PROCEDURE Event( ... ) CLASS HActiveX
LOCAL cEvents := ""
LOCAL aEvents := { ... }
aEval( aEvents, { | xEvent | cEvents += HB_ValToStr( xEvent ) + ", " } )
wapi_OutputDebugString( cEvents )
RETURN
METHOD OnError() CLASS HActiveX
RETURN HB_ExecFromArray( ::oOLE, __GetMessage(), HB_AParams() )
METHOD Close() CLASS HActiveX
wapi_OutputDebugString( "Close" )
::oOLE := NIL
wapi_OutputDebugString( "After Close" )
RETURN NIL