请教一下,下面两段代码在实现的时候,到底有什么不同。
我不知道第二个文件中,有关dll的释放到底有没有效。
请各位高手解释一下两者的不同,特别是调用和释放的情况。//////////////////////////////////
library TB_ZZS;uses
  SysUtils,
  Classes,
  Windows,
  Forms,
  ExtCtrls,
  U_TB_ZZS in 'U_TB_ZZS.pas' {F_TB_ZZS};{$R *.res}function ShowF(App: TApplication): byte; stdcall;
begin
  if not Assigned(Form1) then   //
     Form1:= TForm1.Create(Application);
     Form1.show;
     Result := 0; 
end;exports
  ShowF;begin
end./////////////////////////////////////////////////////////////////////
library BB_ZZS1;uses
  SysUtils,
  Classes,
  Windows,
  Forms,
  u_bb_zzs1 in 'u_bb_zzs1.pas' {F_BB_zzs1};{$R *.res}var
  DLLApp: TApplication;function ShowF(App: TApplication): Byte; stdcall;
begin
  Application := App;  if not Assigned(Form1) then
     Form1:= TForm1.Create(Application);
  Form1.Show;
  Result := 0;
end;procedure DLLUnloadProc(Reason: Integer);
begin
  if Reason = DLL_PROCESS_DETACH then begin
    Application := DLLApp; //恢复
  end;
end;exports
  ShowF;begin
  DLLApp := Application; //保存 DLL 中初始的 Application 对象
  DLLProc := @DLLUnloadProc; //保证 DLL 卸载时恢复原来的 Application
end.
/////////////////////////////////////////////////////