Revision: 12226
http://harbour-project.svn.sourceforge.net/harbour-project/?rev=12226&view=rev
Author: druzus
Date: 2009-08-21 11:35:11 +0000 (Fri, 21 Aug 2009)
Log Message:
-----------
2009-08-21 13:34 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/bin/hb-func.sh
! do not strip system libraries in windows shared linking - unused
ones are not attached to harbour*.dll
* harbour/contrib/hbwin/hbwinole.h
* harbour/contrib/hbwin/olecore.c
+ added support to pass strings with embedded chr(0) characters
+ added new public C function:
IDispatch* hb_oleItemGet( PHB_ITEM pItem );
it extracts IDispatch* pointer from Harbour OLE pointer item.
+ added new public C function:
void hb_oleVariantUpdate( VARIANT* pVariant, PHB_ITEM pItem );
it updates pVariant structure using values from given pointer item
(used to update parameter passed by reference to activex event handler)
% optimized some code
* harbour/contrib/hbwin/hbwinole.h
* harbour/contrib/hbwin/axcore.c
+ added new public C function:
BOOL hb_oleAxInit( void );
+ added new public C function:
PHB_ITEM hb_oleAxControlNew( PHB_ITEM pItem, HWND hWnd );
It's C function with the same functionality as __AXGETCONTROL()
! allocate ISink structure using hb_xgrab() not hb_gcAlloc()
! initialize ISink reference counter to 0
! fixed Release() method to free all allocated resources when
reference counter reach 0
* return new Active-X control as Harbour OLE item pointer.
Warning !!! hb_parptr() and hb_itemGetPtr() do not return valid
pointer for controls created by hb_oleAxControlNew()/__AXGETCONTROL()
Use hb_oleItemGet() and hb_oleParam() to extract pointer to IDispatch
Please update existing code which used __AXGETCONTROL() pointers
at C level.
- removed not longer used hb_sink_destructor
! removed WIN_AXRELEASEOBJECT() - this function breaks reference counters
used by OLE object which needs strict updating to avoid memory leaks
(not freed OLE object) or GPF traps (accessing freed object)
+ extended Invoke() method to update OLE parameters passed by reference.
+ accept as event handler hash arrays indexed by event numbers and
values with codeblocks or function pointers. Similar functionality
exists in HWGUI when it's compiled with __USEHASHEVENTS macro and
it's much better then passing two arrays.
% optimized some code
Please test above Active-X modifications. I'm not MS-Windows user so
they have to be verified by real MS-Windows developers.
They should fix problems with memory leaks (OLE objects where never
freed) or GPF traps in C code which tired to strictly manage reference
counters.
To C programmers: if you increase reference counter to activex control
(AddRef()) then you have to release it (Release()) or activex control
will never be freed even after clearing all .prg references. It's
released only when last reference owner calls Release() method so now
valid code can keep references to IDispatch at C level without any
problem but it also means that this code can exploit problems in
existing wrong code.
Modified Paths:
--------------
trunk/harbour/ChangeLog
trunk/harbour/bin/hb-func.sh
trunk/harbour/contrib/hbwin/axcore.c
trunk/harbour/contrib/hbwin/hbwinole.h
trunk/harbour/contrib/hbwin/olecore.c
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour