On 10 Mar 2015, at 10:40, OBones wrote:
Xiangrong Fang wrote:
However, like in my first mail, if I define THandler a procedure of
object, it makes easier to SetHandler(AMethod); but how can I use
that "procedure of object" pointer in the so?
It works the same, cast the data you receive to a TMethod and call
the "code" member with the appropriate parameters. So, in the "C"
library do this:
Note that you have to make sure that you declare your "procedure of
object" as "cdecl" in that case, and as a result you'll also have to
declare all methods that you want to assign to this procvar as "cdecl".
Jonas
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal