这是一个代码模板,以前集成在RarnuWizard中,由于Delphi版本更新而无法再使用
现提取其中的DLL入口修复模板给大家共享。
library { library name };
uses
SysUtils,Forms, Classes;
{$R *.res}
var
DllApp: TApplication;
DllScr: TScreen;
procedure DLLUnloadProc(Reason: Integer); register;
begin
if (Reason = DLL_PROCESS_DETACH) or (Reason = DLL_THREAD_DETACH) then
begin
Application := DllApp;
Screen := DllScr;
end;
end;
exports
{your export functions here}
begin
DllApp := Application;
DllScr:= Screen;
DllProc := @DLLUnloadProc;
end.