[Hi Benny, sending him the link to the discussion here about incorporating a dll, I found that very helpful. Hope this is ok.]
Hi, I suspect from your handle and that you are using old style procedural types that, like me, you come from Turbro Pascal. I had a major problem changing over from traditional procedural types to class types, and without knowing about Of Object, I got the dreaded zombie object (a recognised term, can't be killed and if left causes a memory leak).
I must admit I don't fully understand what your actual problem is and I don't to speculate as I got told off for that recently in this forum, which was fair enough.
Anyway, a couple of avenues you might want to look at that go slightly off the beaten path, incorporating the DLL into an executable (all kinds of issues with that, including legal) or execute a method.
This is a link to the incorporate discussion here, look at BobDog's code on page 2, I seem to recall trying it recently and it worked (my memory is not what it used to be).
https://forum.lazarus.freepascal.org/index.php/topic,58919.15.htmlAgain, I don't really want to expand on that, just putting it as something to look at for ideas.
This is the link for the execute method, I have this placed into one of my libraries:
https://gist.github.com/ik5/2950789I would say finally, without speculating too much, that I'm not sure that free pascal will allow you the luxury of a single way to incorporate both old and new style procedural methods, but I’m very happy to be proved wrong on that. So I think you need an interface, a medium that both can go through. That would be my way of going. I’m happy to have a further look into this, give me a few days and I’ll come back to this unless one of the smart bods has given you a solution or you’ve found your own.
Phil