Debugging DLL and debugging executable files are the same in most places. In the DLLCodeWhen a breakpoint is reached, the debugger pauses the execution of the DLL. Usually by creating a testProgramRun the test program in the debugger to test the DLL.
However, sometimes you need to test the DLL used by the executable file, and the executable file is created in other development environments. For example, to create a DLL that can be called by Visual Basic applications, you must not run a VB application under the Delphi debugger. All you can do is to tell the Delphi debugger, start the VB application as a main application (naturally, the main application must contain the code to load the DLL ). The run parameters dialog box is used to tell Delphi to start an external main application.
To display the run parameters dialog box, select the run | parameters menu item from the main menu, enter the EXE file name in the Host application field, and click load to run the main application. Shows the run parameters dialog box:
After the main application is started, you can use the Delphi test program to debug the DLL: Set the breakpoint in the DLL and start debugging.
Note
The run parameters dialog box has a remote page, which is used to set parameters for applications on a remote machine. Remote debugging is an advanced debugging content, which is not described here, as shown in: