[Lazarus] Callback and Threads problem

Leonardo M. Ramé l.rame at griensu.com
Fri Apr 6 21:00:11 CEST 2012


On 2012-04-06 17:59:38 +0400, Sergei Gorelkin wrote:
> 06.04.2012 16:31, Leonardo M. Ramé пишет:
> >I have a similar problem to this:
> >
> >http://www.lazarus.freepascal.org/index.php?topic=10571.0
> >
> >My main program launches a thread, that loads a shared library, then
> >execute a function who receives as a parameter a pointer to a callback
> >function and an instance of the caller, as this:
> >
> >procedure TMythread.execute;
> >begin
> >   ...
> >   // external function
> >   runcode(@MyCallBack, @Self);
> >   ...
> >end;
> >
> You should pass 'Self' here, not '@Self'. The latter would be correct for
> TP-style objects, but TThread descendant is a class.
> 
> Regards,
> Sergei
> 

Yes!!!, you are right. That was the problem.

Regards,
-- 
Leonardo M. Ramé
http://leonardorame.blogspot.com




More information about the Lazarus mailing list