windows - dll 中的导出是否区分大小写?

标签 windows delphi dll case-sensitive

我在 win7 和 delphi 2010 上工作。这是我的代码。

library CFGFunc;

uses
sysUtils
Un_ExFuncDll in "base\Un_ExFuncDll.pas"
...

exports
LoadExFuncsInDLL,
...

Un_ExFuncDll.pas 在这里

unit Un_ExFuncDll;
interface    
uses
  Classes;
  procedure LoadexfuncsIndll(); stdcall;
  ...

编译后,dll 不工作。但是我将 LoadexfuncsIndll() 替换为 LoadExFuncsInDLL()(与导出中的内容完全匹配)在 Un_ExFuncDll.pas 中。然后它起作用了。

Delphi 不区分大小写。但似乎 dll 中的导出是区分大小写。 那么,他们有什么关系呢?

最佳答案

导入/导出 DLL 函数区分大小写,而且一直都是。该行为与区分大小写的 OS DLL 加载程序相关联。这是 Delphi 语言中仅有的区分大小写的区域之一。这是记录在案的行为,至少部分是:

Writing Dynamically Loaded Libraries

A name specifier consists of the directive name followed by a string constant. If an entry has no name specifier, the routine is exported under its original declared name, with the same spelling and case. Use a name clause when you want to export a routine under a different name.

Procedures and Functions (Delphi)

In your importing declaration, be sure to match the exact spelling and case of the routine's name. Later, when you call the imported routine, the name is case-insensitive.

关于windows - dll 中的导出是否区分大小写?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20206750/

相关文章:

c++ - 使用 C++ 的全局键盘钩子(Hook)

应用程序已知/可见的 linux 驱动程序功能

dll - TApplication 并将 C++Builder 应用程序拆分为 DLL

c# - C# 程序如何使用任何版本的 C++ dll?

c++ - c :\users be delete when delete windows account?下一个用户账号的文件夹怎么弄

windows - 在 Windows 上使用 node.js 解压文件

Python timeit命令行错误: "SyntaxError: EOL while scanning string literal"

image - 带有图像的 Delphi 弹出框

delphi - 是否有更好的方法将所有数据集字段及其属性复制到另一个数据集?

delphi - 如何在运行时获取表单的实例?