On Wed, 29 Oct 2008, Pritpal Bedi wrote:

Hi Pritpal,

> How I can retrieve pGT in c code sent via prg code.
> Local pGT, pGT1
> pGT := hb_gtCreate( 'WVG' )
> pGT1 := hb_gtSelect( pGT )
> hb_gtInfo( HB_GTI_PGT,  pGT1 )
> IN GT INFO METHOD
> {
>    PHB_GT pGT = hb_itemGetPtr( pInfo->pNewVal );
>    //  I do not receive pGT pointer. What I am missing ?
> }

hb_itemGetPtr( pInfo->pNewVal ) returns pointer to structure
which holds pGT pointer:

   PHB_GT * pGtPtr = ( PHB_GT * ) hb_itemGetPtr( pInfo->pNewVal );
   PHB_GT pGT = *pGtPtr;

Anyhow it may change in the future so I cannot promise that
this code will work. I'd prefer to add new function:
   PHB_GT hb_gt_ItemBase( PHB_ITEM pItemGT )
which can be used with hb_gt_BaseFree() in the same way as
hb_gt_Base() so your code will not be affected by possible
future modifications in internal pGT representation.

best regards,
Przemek
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to