Use DLL to increase strength of software

Source: Internet
Author: User

---- Microsoft Windows provides the special library (DLL) Called dynamic connection library, so that the code and resource sources can be shared in the process sequence. A dll is a package that contains the executable module of the number of dry functions, providing it with a process order for service. Windows uses DLL to provide the code and resource sources that can be used by all windows application procedures. In addition, the user-created dll can also be used to create the user-created DLL, and the user-created tokens and resource sources can be shared between the user-created DLL.

---- The DLL master must have the following mark:

  • Shared tokens and resource sources between applications
  • Anti-Information Filtering Based on System fan Wai
  • Create a standby drive Sequence
  • Application of the process sequence for providing and launching complex applications

---- The question we are studying now is, how can we expand and enhance the performance of software components through DLL? For example: vb4.0 and toolbook3.0.

---- Blandc ++ and MS Visual C ++ are usually used for DLL development. The difference between the two is fixed, however, Ms VisualC ++ is the most convenient. Here we use MS VisualC ++ to develop a demo. dll, which defines a function: F1 = (x, y) = x * Y. Through this example, we can explain the procedural structure of the DLL, and then use the demo. dll call to explain the enhancement of soft parts.

---- Example:

---- Define an F1 (x, y) = x * Y in demo. dll;

---- Three documents are required: Demo. h; demo. C; demo. Def.

* In the header file (demo. h) medium: # include <windows. h> extern int_export_far_pascal F1 (INT, INT); * in the source sequence (demo. c) medium: # include <windows. h> # include "demo. h "int far Pascal libmain (hinstance, word wdatasegment, word wheapsize, lpstr lpszcmdline) {return 1;} int _ export_far_pascal F1 (int x, int y) {int data; data = x * Y; return data;} int far Pascal WEP (INT bsystemexit) {return 1;} * in the module File (demo. def): library demodescription 'C ++ xyy DLL for Windows 'exetype windowscode moveable discardabledata moveable singleheapsize 0 exports F1 @ 1

---- * Use DLL in VB:

---- The first part of the call is to declare the number of signals in the module:

Declare function name lib "DLL name" (byval parameter as datatype,) Declare function F1 lib "Demo" (byval X as integer, byval X as integer) as integer

---- Then, you can use the letter F1 () at any location ().

---- * Use DLLs in toolbook3.0:

---- Before calling, connect to the DLL first, and declare the original type of the letter. The format of the definition is:

Link DLL "demo. dll" function number type function name (parameter number type,) int F1 (INT, INT) end linkdll

---- Leverage the above method to easily develop DLL and use it to expand functions of large parts of software such as vb4.0, toolbook3.0, and delphi1.0, to make the work more powerful, such as: Real-time Control of non-standard hard parts, full demand. In this way, we use the visualized photo editing process of the new software, combined with the advantages of the On-Demand programming of C ++ language, we offered more convenience to our software development.

Related Article

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.