DLL package in Delphi and calling objects

xiaoxiao2021-03-06  38

Specific DLL package object, please see Liu Yi's "DLL package in Delphi" and call object technology "and the distribution source code.

I have encountered some strange problems during the Delphi to prepare the DLL process, and now it is now available for reference only:

1. Write the DLL project generated by Delphi: ShareMem Must Be The First Unit in your library's Uses Clause and your project's. It is mentioned here that the DLL project and the use of the DLL need to reference the ShareMem unit.

The ShareMem unit is best added to the project because it is found in actual use, and sometimes the object is used to use the object to use, the object has a strange error when there is an attribute of the String type.

2, call the DLL function to define the problem:

Output in DLL: Function ABC: IINTERFACE;

And in the program define the function call:

Type

TFUNC = Function: IINTERFACE; stdcall; // More stdcall

Wonderful mistake

It should be defined as defined in the DLL:

Type

TFUNC = Function: ieINTERFACE;

3, when using the interface in the DLL, remember to be set to NIL before the object is released in the DLL;

4, Delphi debugging DLL: When you encounter the debug DLL, you can't add a problem. See the settings in the DLL, the output path and settings of the compiled DLL call the DLL of the main path setting, and should be an absolute path;

5, "DLL package in DELPHI] mentioned that the main restriction on the package object on the package object is mentioned.

转载请注明原文地址:https://www.9cbs.com/read-70574.html

New Post(0)