Hi

Viktor Szakáts wrote:
> 
> I've just checked further and the fix is quite simple 
> and obvious, so I can make it.
> 
> The other comment is that maybe there is no need to 
> make any sort of hack to check for "Q" or "HB" in the 
> beginning of class name, but simply check whether 
> :pPtr member exists and retrieve it if it does. Low 
> level code check for required object pointer type 
> anyway, so there is no need to add these slow and 
> error-prone checks on the higher level.
> 
> Here is a non-optimal/pseudo version of this method:
> (optimal could be done in C probably)
> 
> ---
> FUNCTION hbqt_ptr( xParam )
> 
>    IF hb_isObject( xParam ) .AND. ;
>       __objHasMsg( xParam, "PPTR" ) // we need something which doesn't RTE
> on missing msg and which check for variable.
>        RETURN xParam:pPtr
>    ENDIF
> 
>    RETURN xParam
> ---
> 
> (I assumed XHB stuff is already removed from here)
> 
> Same thing could be rewritten in C probably, for 
> smoother/faster results.
> 


(I assumed XHB stuff is already removed from here)

But why we do not want to include XBP stuff here ?
This does not interacts with XBP anyway, only XBP interacts 
with it, and this poses no harm.

The final function skeleton may be like this

//-------------------//
FUNCTION hbqt_ptr( xParam )

   IF hb_isObject( xParam ) 
      if __objHasMsg( xParam, "PPTR" ) 
         RETURN xParam:pPtr

      elseif __objHasMsg( xParam, "OWIDGET" )
         RETURN xParam:oWidget:pPtr

      endif

   ENDIF

   RETURN xParam
//---------------------//

It will allow to mix HBQT and HBXBP use the same syntax
with interchangele way.

Of course, C level call is much more efficient, I will give it a try.

I have more changes to commit, so please do not commit
anything here, I will do thw spadework, just suggest for 
some time.

Regards
Pritpal Bedi


-- 
View this message in context: 
http://old.nabble.com/SF.net-SVN%3A-harbour-project%3A-13275--trunk-harbour-tp26826400p26834186.html
Sent from the Harbour - Dev mailing list archive at Nabble.com.

_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to