If I *don't* pass the ID, then the control displays as it should, events
work, although it still GPF's on shut down.
Actually, only a few events work, and then GPF, maybe this stack trace will
help:
> hellox.exe!_hb_itemString() + 0x1e bytes C++
hellox.exe!_HB_FUN_HB_VALTOSTR() + 0x1f bytes C++
hellox.exe!_hb_vmProc() + 0x53 bytes C++
hellox.exe!_hb_stackPushReturn() + 0x332e bytes C++
hellox.exe!_hb_vmExecute() + 0x179d bytes C++
hellox.exe!_HB_FUN_HWGACTIVEX() + 0x50 bytes C
hellox.exe!_hb_vmSend() + 0x71 bytes C++
hellox.exe!_hb_stackOldFrame() + 0x14e bytes C++
hellox.exe!_hb_vmExecute() + 0x17ae bytes C++
hellox.exe!_hb_codeblockEvaluate() + 0x1f bytes C++
hellox.exe!_hb_vmEnumRelease() + 0x1ee bytes C++
hellox.exe!_hb_vmSend() + 0x71 bytes C++
hellox.exe!_HB_FUN___AXDOVERB() + 0x44d bytes C
user32.dll!76cbfea1()
[Frames below may be incorrect and/or missing, no symbols loaded for
user32.dll]
user32.dll!76cc0943()
user32.dll!76cc781e()
user32.dll!76cc6aca()
user32.dll!76cbfd72()
user32.dll!76cbfea1()
user32.dll!76cc0943()
user32.dll!76caf99f()
MSCAL.OCX!10006fbf()
MSCAL.OCX!10004e99()
MSCAL.OCX!10004be5()
MSCAL.OCX!10005520()
MSCAL.OCX!1000bb2f()
user32.dll!76cbfd72()
user32.dll!76cbfe4a()
user32.dll!76cbfdf3()
user32.dll!76cc018d()
user32.dll!76cb8b7c()
hellox.exe!_ProcessMessage() + 0xa1 bytes C
hellox.exe!_HB_FUN_HWG_ACTIVATEMAINWINDOW() + 0xd8 bytes C
hellox.exe!_hb_vmProc() + 0x53 bytes C++
hellox.exe!_hb_vmExecute() + 0x6df bytes C++
hellox.exe!_HB_FUN_HMAINWINDOW() + 0x50 bytes C
hellox.exe!_hb_vmSend() + 0x71 bytes C++
hellox.exe!_hb_vmExecute() + 0x900 bytes C++
hellox.exe!_HB_FUN_MAIN() + 0x10 bytes C
hellox.exe!_hb_vmProc() + 0x53 bytes C++
hellox.exe!_hb_vmInit() + 0x223 bytes C++
hellox.exe!_winm...@16() + 0xf3 bytes C++
hellox.exe!__tmainCRTStartup() Line 263 + 0x1b bytes C
kernel32.dll!75d3d0e9()
ntdll.dll!776819bb()
ntdll.dll!7768198e()
Regards
Alex
My current app FWIW:
#include "hbclass.ch"
#include "windows.ch"
#include "guilib.ch"
static oMSCAL
static oBPTI
memvar oMainWindow
public oMainWindow
function main()
INIT WINDOW oMainWindow MAIN TITLE "Hello ActiveX" ;
AT 200, 0 SIZE 420, 300
MENU OF oMainWindow
MENU TITLE "&File"
MENUITEM "Test &MSCal" ACTION { || MSCALInit() }
MENUITEM "&Change Date" ACTION { || oMSCAL:NextDay() }
SEPARATOR
MENUITEM "Test &BPTI" ACTION { || BPTIInit() }
//MENUITEM "Init BPTI" ACTION { || msginfo(HB_ValToStr(oBPTI)),
oBPTI:InitLan("127.0.0.1", 2000) }
//MENUITEM "Disconnect BPTI" ACTION { || oBPTI:disconnect() }
SEPARATOR
MENUITEM "E&xit" ACTION { || EndWindow() }
ENDMENU
ENDMENU
MsgInfo( "Activate" )
ACTIVATE WINDOW oMainWindow
MsgInfo( "Setting oMSCAL to nil" )
oMSCAL := nil
MsgInfo( "Setting oBPTI to nil" )
oBPTI := nil
return nil
procedure MSCALInit()
//oMSCAL := HWGActiveX():New( oMainWindow, "MSCAL.Calendar", 0, 0, 300,
300, "8E27C92D-1264-101C-8A2F-040224009C02" )
//oMSCAL := HWGActiveX():New( oMainWindow, "MSCAL.Calendar", 0, 0, 300,
300, "00020400-0000-0000-C000-000000000046" )
oMSCAL := HWGActiveX():New( oMainWindow, "MSCAL.Calendar", 0, 0, 300, 300 )
return
procedure BPTIInit()
//oBPTI := HWGActiveX():New( oMainWindow, "BPTI.CoBpTiX1", 0, 0, 300, 300,
"F41DF7FB-5014-4859-B4DD-854A9D2143CC" )
oBPTI := HWGActiveX():New( oMainWindow, "BPTI.CoBpTiX1", 0, 0, 300, 300,
"22BDC4E0-B4CF-4A29-8D6D-D7D17195394B" )
//oBPTI := HWGActiveX():New( oMainWindow, "BPTI.CoBpTiX1", 0, 0, 300, 300 )
oBPTI:InitLan("127.0.0.1", 2000)
return
CLASS HWGActiveX FROM HControl
CLASS VAR winclass INIT "ACTIVEX"
DATA oOLE INIT NIL
METHOD New
METHOD Event
ERROR HANDLER OnError
ENDCLASS
METHOD New( oWnd, cProgId, nTop, nLeft, nWidth, nHeight, cID ) CLASS HWGActiveX
local nStyle
local hWnd
nStyle := WS_CHILD + WS_VISIBLE + WS_CLIPCHILDREN
//Super:New( oWnd, , nStyle, nLeft, nTop, nWidth, nHeight )
WIN_AxInit()
hWnd := WAPI_CreateWindowEX( 0, "AtlAxWin", cProgId, nStyle, nLeft, nTop,
nWidth, nHeight, WIN_N2P( oWnd:handle ), 0 )
::oOLE := WIN_AxGetControl( hWnd, { | event, ... | ::Event( event, ... ) },
cID )
return self
METHOD Event( event, ... ) CLASS HWGActiveX
MsgInfo( HB_ValToStr( event ) )
MsgInfo( HB_ValToStr( ... ) )
return NIL
METHOD OnError() CLASS HWGActiveX
return HB_ExecFromArray( ::oOLE, __GetMessage(), HB_AParams() )
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour