在我的项目中,我有一个 Windows 应用程序和一个 dll。我这样写了dll:
library MyDLL;
uses
System.SysUtils,
System.Classes;
{$R *.res}
function Prova: string; export;
begin
result := 'prova';
end;
exports Prova;
begin
end.
在主程序中我调用了例程:
unit FrmMain;
interface
uses
// declaration uses //
function Prova: string; external 'MyDLL.dll';
type
// declaration type //
implementation
begin
...
TAdvEdit1.Text := Prova; // [1] //
...
end;
end.
当我编译所有项目时没有报告错误,并且状态报告成功,但应用程序没有启动。如果我删除线 [1] 那么它工作正常。通常,当我调用函数 Prova 时,应用程序不会启动。我能解决这个问题吗?非常感谢。