CN103092590A - DLL sealing and invoking method of Delphi - Google Patents

DLL sealing and invoking method of Delphi Download PDF

Info

Publication number
CN103092590A
CN103092590A CN2011103459557A CN201110345955A CN103092590A CN 103092590 A CN103092590 A CN 103092590A CN 2011103459557 A CN2011103459557 A CN 2011103459557A CN 201110345955 A CN201110345955 A CN 201110345955A CN 103092590 A CN103092590 A CN 103092590A
Authority
CN
China
Prior art keywords
dll
delphi
sealing
invoking
objects
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN2011103459557A
Other languages
Chinese (zh)
Inventor
杨际荣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZHENJIANG HUAYANG INFORMATION TECHNOLOGY CO LTD
Original Assignee
ZHENJIANG HUAYANG INFORMATION TECHNOLOGY CO LTD
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ZHENJIANG HUAYANG INFORMATION TECHNOLOGY CO LTD filed Critical ZHENJIANG HUAYANG INFORMATION TECHNOLOGY CO LTD
Priority to CN2011103459557A priority Critical patent/CN103092590A/en
Publication of CN103092590A publication Critical patent/CN103092590A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

According to a DLL (Dynamic Link Library) sealing and invoking method of Delphi, DLL is a dynamic linking technique with the most widely application range. Due to the fact that sealing and invoking objects in DLL meet object dynamic binding mechanism limits, accordingly, DLL has a certain technical difficulties in encapsulated objects, and some Delphi programmers misunderstand that DLL just supports encapsulated function but not the encapsulated objects. The DLL sealing and invoking method of Delphi focuses on a special principle and idea of the sealing and invoking objects in DLL.

Description

DLL encapsulation and the call method of a kind of Delphi
Technical field
The present invention relates to DLL encapsulation and the call method of a kind of Delphi, particularly be the way of thinking that how to encapsulate and call in DELPHI.
Background technology
So if the modules of program is kept at respectively in different unit files and by the taking-up subroutine compiled code and adding in execute file from unit that Delphi compile or static library of connector after uses instruction each the static subroutine compiling of a typical static linkage of calling mutually that Here it is in Delphi.Static linkage can't realize that physically cutting is connected with encapsulation in case wherein certain unit or module are changed other all unit or module and all got and recompilate and be connected thereupon.
Summary of the invention
Based on the above issues, hereby invent a Delphi DLL package and call the method; first is the physical package with dynamic linking, for the realization of the physical cutting and packaging bpl package dynamic link library DLL or COM + components are in the form of a dynamic link dynamic link connector case subroutine external use only statement that the information in the executable file generated some data tables loaded into memory when Windows executable file when it is first loaded all required DLL and the program will start in the process of loading Windows use the function in memory address shim internal tables whenever the program calls an external function it will use the internal data tables directly on the DLL code it is currently loaded in the program's address space to call attention to this mode will not be involved in two different application DLL has become a part of the application and loaded in the same address space, all parameters are passed on the stack occurs with any other function call, like we do not intend to discuss here the DLL compiled because we first want to focus on Delphi the DLL package and object technology.
The secondth, use the DLL encapsulated object, the example of DLL encapsulated object is CarObj and the BicycleObj function creation that creates in DLL and has exported the such DemoSvr dynamic link library of quoting of Car object and Bicycle object and just can export Car object and Bicycle object by CarObj and BicycleObj function.
The 3rd is the dynamic binding that utilizes object in Delphi Interface realization DLL.The application program of calling DLL can only use the method for the dynamic binding of object in DLL understand this point be the key that realizes the DLL encapsulation and use object so the Delphi interfacing provide an optimal selection for us.Using interface also to bring more benefit at first to need not to use virtual and abstract qualifier to revise the object method statement has avoided the illusion on the program reading secondly to utilize the lifetime of the automatic management object of interface instance counter to avoid the programmer to forget the memory overflow that the destruction object causes.
The 4th is to use abstract class to realize the dynamic binding of object in DLL.Since restriction that in DLL, encapsulation and allocating object have been subject to the object binding mechanism so except utilizing the Delphi interfacing we it is also conceivable that with abstract class realize object in DLL binding mechanism it encapsulated outer appearnce TfrmUsers I service part comprise data module be designed to provide service server this be the thought of its interface that encapsulated service class TuserMaint and this design indicates of database access class TuserDM of a dynamic link library file UserSvr.dll and service detach.Due to the application program of calling DLL can only use the dynamic binding of object in DLL method we might as well specialized designs abstract class TIUserMaint as the interface that object method is provided in abstract class TIUserMaint by for the object method of application program only they be all empty abstract method purpose be the support dynamic binding and need not to provide realize a general abstract class defining interface it by empty abstract method form there is no reality data in order to realize abstract class
The original TUserMaint class of the abstract method of TIUserMaint need to be inherited the TIUserMaint class and cover that they are all
The TUserMaint class declaration that empty abstract method is new is as follows
TUserMaint=class(TIUserMaint)
private
UserDM:TUserDM;
public
function?GetDepList:TStrings;override;
function?GetUserList(strName:String):OLEVariant;override;
procedure?UpdateUserData(UserData:OleVariant;out?ErrCount:Integer);
override;
constructor?create;override;
destructor?Destroy;override;
end;
But in fact the TUserMaint class original to realize that so part does not need to change our workload little.

Claims (2)

1. the DLL of a Delphi encapsulates and call method: the method is mainly encapsulation technology and the dynamic call method of the DELL of DELPHI.
2. according to claim 1 DLL encapsulation and the call method of Delphi, the method is mainly realized the dynamic binding of object in DLL by the dynamic binding that utilizes object in Delphi Interface realization DLL with the DLL encapsulated object and use abstract class.
CN2011103459557A 2011-11-01 2011-11-01 DLL sealing and invoking method of Delphi Pending CN103092590A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2011103459557A CN103092590A (en) 2011-11-01 2011-11-01 DLL sealing and invoking method of Delphi

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2011103459557A CN103092590A (en) 2011-11-01 2011-11-01 DLL sealing and invoking method of Delphi

Publications (1)

Publication Number Publication Date
CN103092590A true CN103092590A (en) 2013-05-08

Family

ID=48205207

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2011103459557A Pending CN103092590A (en) 2011-11-01 2011-11-01 DLL sealing and invoking method of Delphi

Country Status (1)

Country Link
CN (1) CN103092590A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111562951A (en) * 2020-05-11 2020-08-21 电子科技大学 Radar application component service implementation method

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101814032A (en) * 2010-02-08 2010-08-25 河南大学 Resource encapsulation method utilizing Delphi resource file to generate Windows application program

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101814032A (en) * 2010-02-08 2010-08-25 河南大学 Resource encapsulation method utilizing Delphi resource file to generate Windows application program

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘艺: "Delphi中的DLL封装和调用对象技术", 《DR.DOBBS软件研发》, no. 3, 31 October 2003 (2003-10-31) *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111562951A (en) * 2020-05-11 2020-08-21 电子科技大学 Radar application component service implementation method
CN111562951B (en) * 2020-05-11 2022-05-03 电子科技大学 Radar application component service implementation method

Similar Documents

Publication Publication Date Title
JP3689368B2 (en) Method of loading an application into a multi-application embedded system with data processing resources, corresponding system and execution method
KR101581796B1 (en) Sharing virtual functions in a shared virtual memory between heterogeneous processors of a computing platform
US7219329B2 (en) Systems and methods providing lightweight runtime code generation
CN109299587A (en) Algorithm protection method, device, equipment and storage medium based on go language
CN103729184A (en) Software component combining and constructing method
Fischer et al. Tasks: language support for event-driven programming
JP2019040626A (en) System and method for supporting object oriented scripting tool
WO2024045379A1 (en) Compiling method, compiler, and wasm virtual machine
CN102455931B (en) Method and system for developing Android platform engineering
CN102023885A (en) Method and system for storing bytecode of JCRE (Java card run time environment)
WO2018032653A1 (en) Function implementing method and apparatus for java card application
CN103092590A (en) DLL sealing and invoking method of Delphi
Buckley Project Jigsaw: Under The Hood
Rajan et al. Capsule-oriented programming in the Panini language
CN106681782B (en) Method and device for compiling dynamic link library SO file of android installation package
Dong Aspect oriented programming technology and the strategy of its implementation
Mohanty et al. Basic solidity programming
Loiret et al. Software engineering of component-based systems-of-systems: a reference framework
Potanin et al. Defaulting generic Java to ownership
Mukherjee et al. Develop once deploy anywhere achieving adaptivity with a runtime linker/loader framework
Malhotra Dynamic extensibility in a statically-compiled object-oriented language
Kächele et al. nOSGi: a posix-compliant native OSGi framework
Sharan et al. Enhanced Deprecation
SIMION et al. MODELS OF CLASSES FOR ECONOMIC OBJECTS IN APPLICATIONS.
Johnson SWIG+ Fortran User Manual

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20130508