On Tue, 12 Jan 2010, Xavi wrote: Hi,
> I'm trying to mix both versions but when the address of the HB_GC_FUNCS > is not available I don't know how to do it. > Yes, thank you Przemek, I can do the same with .- > HANDLE wapi_par_HANDLE( int iParam ) > { > PHB_ITEM pItem = hb_param( iParam, HB_IT_POINTER ); > if( pItem && pItem->item.asPointer.collect ) > return ( HANDLE ) *(( void ** )pItem->item.asPointer.value); > return ( HANDLE ) ( pItem ? pItem->item.asPointer.value : NULL ); > } > But I'm using internal HB_ITEM structure and also is wrong. Yes, it is. Anyhow accepting unknown pointer items is also wrong and I do not want to add to core code functions which are not usable for code which cleanly checks all pointer items. > I use examples of hbwin because is in the repository and it's adapt well. > Try to imagine that wapi_CreateMutex() is in an external library. > How to do wapi_WaitForSingleObject() to accept the mutex? It can be done in few different ways, i.e. you can add public function which will operate on on different pointer items, or you can implement some casting or aliasing mechanism like the one I sent as example for HBQT few months ago. Looks that it creates problems for different developers so maybe in some spare time I'll try to add template code or some very basic HVM support for GC pointer item aliasing which should help in such situations. Maybe I'll join it with OOP support for GC pointer items which is still on my TODO list. best regards, Przemek _______________________________________________ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour