Allan Fernandes
Allan Fernandes

Reputation: 121

Loading a dll at run-time - Delphi

I use a dll that has above 300 functions and I need at least 50 of them. I need to load the functions during run time using LoadLibrary , GetProcAddress etc. My problem is that my code is becoming too huge, around 500 lines. Is there a more refined method ?

Upvotes: 0

Views: 1750

Answers (1)

Remy Lebeau
Remy Lebeau

Reputation: 596156

Depending on which version of Delphi you are using, you might find it easier to use Delphi's Delay Load feature by adding the delayed keyword to the DLL function declarations and let Delphi handle the LoadLibrary() and GetProcAddress() calls for you.

Upvotes: 2

Related Questions