问题描述
uses
SysUtils,
Classes;
{$R *.res}
function add(Value1:integer;value2:integer):integer;stdcall;
begin
Result:=Value1+value2;
end;
function subtract(Value1:integer;value2:integer):integer;stdcall;
begin
Result:=Value2-value1;
end;
function multiply(Value1:integer;value2:integer):integer;stdcall;
begin
Result:=Value1*value2;
end;
function divide(Value1:integer;value2:integer):integer;stdcall;
begin
Result:=Value2 div value1;
end;
function check(Value1:integer;value2:integer):Boolean;stdcall;
begin
if(Value2>value1)then
Result:=True
else
Result:=False;
end;
exports add,subtract,multiply,divide,check;
这是我的dll代码。即使我给出口它的作品。我可以知道这两个关键字的用法之间的区别吗。
this is my dll code. even if i give export it works. may i know the difference between the usage of these two keywords.
推荐答案
导出
关键字来自16位版本。它在现代版本的Delphi中被忽略。不要将其与 exports
指令混淆,该指令用于指定从库中导出哪些函数,以及在所显示的代码中正确使用了哪些函数。
The export
keyword is a legacy from 16 bit versions. It is ignored in modern versions of Delphi. Do not confuse it with the exports
directive which is used to specify which functions are exported from a library, and which you use correctly in the code presented.
将导出
与 stdcall $ c进行比较没有多大意义。 $ c>,一个调用约定指令,因为它们不能直接比较。
It doesn't make much sense to compare export
with stdcall
, a calling convention directive, since they are not directly comparable.
这篇关于请给我使用delphi7导出Dll中的函数时使用export和stdcall关键字的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!