On the plug-in programming in Delphi

Source: Internet
Author: User

Objective

I write the Delphi program is from the MIS system, beginning to try to partition the subsystem when using the MDI form structure. With the expansion of the system function, there are new subsystems to join the system, a single project will become very large, every time to do a little modification to recompile, the form of a single project is not conducive to teamwork. To improve productivity, I want to use DLL dynamic link library form to implement the plug-in structure programming.

The programming of the plug-in structure requires a plug-in container to control the operation of each DLL, arranging each subsystem into a DLL library file. For each DLL program, you need to reserve an interface function for the container, and the generic interface functions include: Start the function that calls the DLL library, and close the DLL library. Through the interface function, the plug-in container can transfer parameters to the DLL module to implement dynamic control. Detailed implementation details I will explain and give the response code below.

You may need to understand the structure of the Unit in Delphi, the structure of the project. This article did not delve into the theoretical details of DLL programming, but only demonstrated some practical code, I was learning Liu Yi Teacher's "Delphi in-depth Programming" book.

I am also in the introductory stage of Delphi, just feel that this DLL development there are some worthy of discussion, so write this article, I hope you can do for me a bad place generous suggestions.

Introduction to Sample Programs

For readability I will use part of the MIS system's program code to demonstrate some of the methods of plug-in programming. The sample program is a typical C/s structure DBMS application, and our focus will be on the control statements of the framework Program (Hall) and the response control of the DLL plug-in program.

1. Program Structure

Plug-in Container Hall is created with a separate project, Hall's main window acts as an MDI container form in the MDI program, and Hall will explicitly call the interface functions in the DLL.

Each plug-in uses its own engineering independently, unlike ordinary engineering, DLL engineering creates DLL Wizard, and the resulting file is a DLL suffix.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.