On 04.08.2010 14:17, Jorge Aldo G. de F. Junior wrote:
i already know about virtual metods,

by dynamic dispatch i mean to call a procedure by its name, at
runtime, not at compile time...

i simply dont know how to do it (maybe object pascal doesnt support this ?)


You could try to use TObject.MethodAddress ( http://www.freepascal.org/docs-html/rtl/system/tobject.methodaddress.html ), but it might only work with published methods (I haven't tested it yet). Also you need to declare a method type to which the returned pointer can be cast to, so that you can call it like a "normal event handler".

Regards,
Sven
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to