By definition DLLs are dynamically loaded libraries of functions and sometimes data. However, it's possible to either hard code the ability to "import" functions from DLLs or dynamically "bind" a DLL during the run time -- which of course means that we don't necessarily need to know the name of the DLL nor the name of the function we're about to call (to a certain extent) during the time we code. Dynamically loading and unloading DLLs could not only save memory, but also can help you write programs that are able to "adjust" itself if certain DLLs are missing.
Following "LoadAndRunDLLProcedure()" function will let you pass the name of the DLL you want to connect to and the name of the function you want to call. If everything goes well, it will load the DLL, call the function, and then unload the DLL.
function LoadAndRunDLLProcedure( |
LoadAndRunDLLProcedure( |
procedure HelloWorld;or in C:
void HelloWorld();
Source : http://www.chami.com/tips/delphi/011097D.html
0 comments:
Post a Comment