

For the beginning start Delphi and select File | New. Creating a Dynamic Link Library The following few lines will demonstrate how to create a simple DLL using Delphi. Naturally, using Delphi, we can write and use our own DLLs, and we can call functions in DLLs developed with other systems / by other developers (like Visual Basic, or C/C++). The concept of DLLs is the core of the Windows architectural design, and for the most part Windows is simply a collection of DLLs. Like units, DLLs contain sharable code or resources, they provide the ability for multiple applications to share a single copy of a routine they have in common. A Dynamic Link library, or DLL, is a collection of routines (small programs) that can be called by applications and by other DLLs. You can download the executable of the demo as EXEWDEMO.ZIP.ĭelphi software at Download Typhoon, free software downloads, Development/Delphi. A click on the second button prints the file whose name is in the edit-box above it. If the checkbox is checked, the demo will wait for the completion of the external program. To make it easier to see what is happening, we made the window of the demo stay on top of all other windows. I wrapped it all up in a ready-to-go demo project (see picture above), which demonstrates the use of the functions discussed above.

The simplest method is: start the external application with ShellExecuteEx and then monitor the process handle with WaitForSingleObject. That process handle can be obtained by using one of two Win32 API-functions to start the external program: ShellExecuteEx or CreateProcess. We can tell if a process has completed by monitoring its process handle. Launching an external program and waiting until it is terminated is quite another story. Video Tutorials by Alister Christie (Codegearguru)ĭelphi Tutorial: Running an external application w ShellExecute.
