library dllTry;uses
//... // fun1
function fun1(): Integer;
begin
// ...
end;// fun2
function fun2(): Integer;
begin
// ...
end;exports
fun1, fun2;end.程序结构大概是这样,调用时,fun1可以,fun2却不成,提示找不到这个函数。改了改名字,不可以。把fun1的内容copy,改个名字,再调用,还是不可以。
//... // fun1
function fun1(): Integer;
begin
// ...
end;// fun2
function fun2(): Integer;
begin
// ...
end;exports
fun1, fun2;end.程序结构大概是这样,调用时,fun1可以,fun2却不成,提示找不到这个函数。改了改名字,不可以。把fun1的内容copy,改个名字,再调用,还是不可以。
解决方案 »
- 如何读取CSV文件~~~~~~~~~~~~~~~~~~~
- 一个很简单的问题
- 为什么我的程序在英文操作系统是录入中文就会出现乱码呢,而且不能保存到数据库中?
- 函数调用的时候,参数少写一个,仍能成功调用,为什么???
- 请教一个问题?---在线等待
- 100分!哪里有免费的fast report(非试用版)?非常感谢!
- 情人节紧急问题求助!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- Help Me,A Problem Of ADOQuery.SQL.Text.
- 谁能给我个在DBGrid添加ComboBox的例子代码? 50分.
- 关于QuickReport的一个相当简单的问题。
- 请问如何获得目前客户端连接的状态如何?
- 关于Ttoolbar控件在Ttoolbutton中同时显示image和caption的瓜问题
function fun2(): Integer;stdcall;
begin
// ...
end;
-------------
library CompareP;uses
SysUtils,
Classes;
{$R *.res}
Function MinN(ArrayInput:Array of double):double;stdCall;
var
i:integer;
begin
Result:=ArrayInput[low(ArrayInput)];
For i:=low(ArrayInput) to high(ArrayInput) do
begin
if Result > ArrayInput[i] then
Result:=ArrayInput[i];
end;
end;Function MaxN(ArrayInput:Array of double):double;stdCall;
var
i:integer;
begin
Result:=ArrayInput[low(ArrayInput)];
For i:=low(ArrayInput) to high(ArrayInput) do
begin
if Result <= ArrayInput[i] then
Result:=ArrayInput[i]
else
Result:=Result;
end;
end;
exports
MinN,
MaxN;
begin
end.
--------------------------------
调用
unit CallDLL;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TCallDllF = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
Function MaxN(ArrayInput:Array of double)
:double;stdCall;external 'bin\CompareP.dll';
Function MinN(ArrayInput:Array of double)
:double;stdCall;external 'bin\CompareP.dll';
var
CallDllF: TCallDllF;implementation{$R *.dfm}procedure TCallDllF.Button1Click(Sender: TObject);
var
DoubleArray:array of double;
i,j:integer;begin
Canvas.TextOut(40,40,(TimeToStr(now())));
setLength(DoubleArray,100000); for i:=low(DoubleArray) to high(DoubleArray) do
DoubleArray[i]:=i;//random(i)+10;
for j:=0 to 1000 do
Caption:= FloatToStr(MinN(DoubleArray))
+' '+
FloatToStr(MaxN(DoubleArray));
Canvas.TextOut(40,80,(TimeToStr(now())));
end;end.