On Wed, 21 Oct 2009, Alex Strickland wrote:
> I must explicitly call oMSCal:Close() to set ::oOLE to NIL, or else
> it will GPF. Is that expected behaviour?
> I cannot make the DESTRUCTOR work, it is simply not called, can you
> see why? I tried it in the three commented lines above.
And this is the source of problems which explains the GPF traps you have.
You are passing oMSCal to AX handler indirectly by SELF in codeblock:
::oOLE := WIN_AxGetControl( hWnd, ;
{ | event, ... | ::Event( event, ... ) }, cID )
It causes that oMSCal is never cleared because above codeblock containing
the reference to oMSCal is attached AX window by hb_itemNew().
If you use in your code as even handler sth what does not keep reference
to oMSCal and it will resolve all your problems, i.e:
::oOLE := WIN_AxGetControl( hWnd, ;
{ | event, ... | MyEvent( event, ... ) }, cID )
[...]
PROCEDURE MyEvent( ... ) CLASS HActiveX
wapi_OutputDebugString( hb_valToExp( { ... } ) )
return
Looks that it's a time to extended our GC and add support for references
between GC blocks. I'll try to make it soon before we release 2.0.
best regards,
Przemek
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour