简体   繁体   English

使用DLL中的所有函数而不在应用程序中声明每个函数 - Delphi

[英]Use all functions in DLL without declaring every one in application - Delphi

I learned something about DLL's yesterday. 我昨天学到了关于DLL的一些知识。 But I haven't found the way how to use all of the functions and procedures in DLL without writing this line into code of application for every function and procedure I want to use. 但我还没有找到如何使用DLL中的所有函数和过程的方法,而无需将此行写入我想要使用的每个函数和过程的应用程序代码中。

function CircleArea(const radius : double) : double; external 'circle.dll';

Unfortunately, for standard DLLs in Windows, there isn't a standard to define each function's parameter types, so there is not any way to say "Please generate the code for all of the functions in this DLL". 不幸的是,对于Windows中的标准DLL,没有定义每个函数的参数类型的标准,因此没有任何方法可以说“请为此DLL中的所有函数生成代码”。

There have been various attempts to do this over the years, mostly integrated into other technologies, from COM all the way to .Net. 多年来已经进行了各种尝试,主要集成到其他技术中,从COM一直到.Net。 Indeed, Delphi's BPL format is essentially a DLL with this sort of information included as well as code to share all of the type information between the DLL and the main application. 实际上,Delphi的BPL格式本质上是一个包含此类信息的DLL,以及用于共享DLL和主应用程序之间的所有类型信息的代码。

N@ N - [

也许您可以将DLL导入声明放在一个单元中,将单元保存到公共文件夹并在所有项目中使用此单元。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM