void * hbqt_gcpointer( int iParam ) { HB_TRACE( HB_TR_DEBUG, ( "hbqt_gcpointer iParam=%d", iParam ) ); QGC_POINTER * p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), iParam ); if( p && p->ph ) { HB_TRACE( HB_TR_DEBUG, ( "hbqt_gcpointer returns p->ph ph=%p", p->ph ) ); return p->ph; } else if( HB_ISPOINTER( iParam ) ) { HB_TRACE( HB_TR_DEBUG, ( "hbqt_gcpointer returns hb_parptr( iParam ) " ) ); return hb_parptr( iParam ); /* TOFIX: In what cases is this needed? Reference counting to avoid referring to freed pointers? */ } else { HB_TRACE( HB_TR_DEBUG, ( "HBQT_GCPOINTER RETURNS NULL " ) ); return NULL; /* TODO: Still better if RTE. */ } }
>From my logs, you can't RTE because when you, for example, create a QPushButton with hello := QPushButton():new( ) there is a pObj = ( QPushButton* ) new QPushButton( hbqt_par_QWidget( 1 ) ) ; hbqt_par_QWidget( 1 ) is a define to hbqt_gcpointer... if parameter at harbour level is not present hbqt_gcpointer returns NULL. If the parameter is mandatory, probably it should be enforced at harbour class level.... Francesco there is a HB_TRACE( HB_TR_DEBUG, ( "HBQT_GCPOINTER RETURNS NULL " ) ); return NULL; /* TODO: Still better if RTE. */ _______________________________________________ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour