On 30/11/07 22:05, "Charles Yeomans" <charles at declareSub dot com> wrote:
>
> Actually, this isn't quite right. I think it's more accurate to say
> that when a delegate is converted to Ptr, any information about the
> object is stripped, and all that's left is the function pointer
> itself. So you can pass an object method delegate to an external
> callback, but all that is passed is the function pointer,
I suspect that all RB class methods actually contain an invisible "this"
pointer argument - as per C++ ( and RB plugins ) that points to the class
instance somehow, so if you ask RB to get the pointer to a method on a RB
class instance you are pointing to a function which contains an extra
argument that the external library which will call the callback isnt
expecting. This is why you get crashes.
Of course using delegates to RB methods will be fine within RB itself.
>and you
> can't go back.
More to the point - you'll get a crash. Well I certainly did.
>
> Charles Yeomans
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
>
> Search the archives:
> <http://support.realsoftware.com/listarchives/lists.html>
>
Cheers,
Dan
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|