Quote Originally Posted by Darkhog
Nope. Procedure getModuleHandle don't exist in LAZARUS. And please don't give me code for Delphi, because this simply don't work, on Linux
First up, I don't see a massive number of replies, and given you've already asked the question on the Lazarus forums and gotten no replies... any information you get should be gratefully received as a possible solution or even better, a pointer to possible solutions.

Secondly, your statement about code for Delphi not working on Linux. Thats not strictly true. I have a cross platform (Windows/Linux) service that compiles with Delphi and Kylix, the wrapper is different as one is a service whilst the other is a daemon, but the core code itself is the same, so it's not that Delphi (or more accurately Object Pascal) won't work on Linux, it's a case of some of the features available within Delphi, namely the Windows API do not have equivalent functions under Linux. So, this rules out the example code I provided which makes use of getProcAddress... but did you read the article I pointed you to?

That utilises methodAddress, which of course means you can only find the address of a method of a class, but it DOES work with Free Pascal. Lazarus is built on Free Pascal is it not?

I hope you can see now why I asked for more information about what and how you were going to use it. The code I presented is more flexible in that you aren't limited to class methods, but it may not work everywhere, whilst the methodAddress approach is limited to class methods, but it does work everywhere because its a core language feature.

In future I would suggest you adopt a slightly more grateful tone when replying to someone who is trying to help. If you don't, people will pretty quickly stop helping.

So, I'll reiterate my questions... how are you planning on using this? Can the routines you want to call be class methods? If not, why not? If they can, the methodAddress approach can be used... although from a performance point of view, there may be better approaches. A more object orientated method for example.