DelphiFAQ Home Search:
General :: Windows :: Programming :: Windows with Delphi :: Windows Filesystem
File related questions and answers. File operations, attributes, system dialogs, hard disk handling.

Articles:

This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

Only the 40 most recently viewed articles are shown.
You can see the full list here.

Featured Article

DLLs: Import dynamic or static

Both techniques have their advantages.
Static importing means you define functions like this:

function f : integer;
   external 'mydll.dll';

The advantage of static imports are:
  • It is easy - it does not require ugly code.
  • The application will only start up if all DLLs are present and can be loaded (this could also be considered a negative)
  • All functions across all modules are bound during startup time.
Dynamic importing has its advantages as well.
  • It basically gives you full control over the usage of the DLL. If your DLL is only needed rarely for a seldomly used function, you may not want to load it at startup of your application. Your application will start faster then.
  • If the application will work without that DLL to a usable extent, you may allow the user to do so.
  • If you have different DLLs for different environments, for example one for Windows NT, another one for Windows 95 etc, then you MUST bind dynamic - you determine the operating system and load the DLL that you want.
  • dynamic binding allows you to release the DLL if you do not need it anymore
The following code shows you how to do it:

Dynamic loading and binding of DLLs