Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi pointer syntax

I have to pass an argument of the type Pointer to a function from an external DLL.

  • How do I create a pointer to a procedure which I can then pass to the function?
  • Can I also pass a pointer to a class member function to the external function, or will that not work?
like image 424
lamas Avatar asked Apr 09 '26 12:04

lamas


1 Answers

Just use @MyProcedure for that.

Beware that it has to have the right calling convention (probably stdcall).

You usually can't use a member function, because it has a hidden SELF parameter.

A class static method acts like a usual procedure/function though.

http://docwiki.embarcadero.com/RADStudio/en/Methods

like image 175
Jens Mühlenhoff Avatar answered Apr 12 '26 09:04

Jens Mühlenhoff