L
lsys
Unregistered / Unconfirmed
GUEST, unregistred user!
[red]]第一个问题[/red]
数据结构
unit URecorder;
interface
uses ADODB;
type
TPubVar=record
AppHandle:THandle;
AppADOCNN:TAdoConnection;
UserName:Shortstring;
UserID:integer;
IPID:integer;
end;
implementation
end.
------------------------
DLL过程
....
Procedure Operator(UG_PubVar:TPubVar);stdcall;
var
FMOperator: TFMOperator;
implementation
uses UGlobal;
{$R *.dfm}
Procedure Operator(UG_PubVar:TPubVar);
begin
Application.Handle:=UG_PubVar.AppHandle;
UGlobal.UG_PubVar:=UG_PubVar;
with TFMOperator.Create(Application) do
try
ShowModal;
finally
Free;
end;
End;
---
申明调用过程(静态调用)
Procedure Operator(UG_PubVar:TPubVar);stdcall;external 'sysDLL.dll';
--------
----------------------------------------
向上面的过程有20~30个
在调用过程的次数多了程序关闭,进程中还有在运行中。
后来采用
//
begin
Application.Initialize;
UGlobal.UG_PubVar.AppHandle:=Application.Handle;
FMFalsh := TFMFalsh.Create(nil);
try
FMFalsh.Show;
FMFalsh.Update;
try
Application.CreateForm(TFMDMBase, FMDMBase);
Application.CreateForm(TFMMain, FMMain);
UGlobal.UG_PubVar.AppADOCNN:=FMDMBase.ADOCNN;
except
ShowMessage('数据库连接失败,'+#13#10+'确定连接后重试!');
Application.Terminate;
end;
FMFalsh.Update;
finally
FMFalsh.Free;
end;
try
if Landing then//登陆函数
Application.Run
finally
Application.Terminate;//[red]用该命令强制终止程序[/red]
end;
有没有其他的办法判断DLL是否释放
第二个问题
DELPHI帮助里的的一段代码,这段代码起什么作用,怎样使用他
library ??;
uses
SysUtils,
Classes,
var
SaveExit: Pointer;
procedure LibExit;
begin
... // library exit code
ExitProc := SaveExit
// restore exit procedure chain
end;
begin
... // library initialization code
SaveExit := ExitProc
// save exit procedure chain
ExitProc := @LibExit
// install LibExit exit procedure
end.
数据结构
unit URecorder;
interface
uses ADODB;
type
TPubVar=record
AppHandle:THandle;
AppADOCNN:TAdoConnection;
UserName:Shortstring;
UserID:integer;
IPID:integer;
end;
implementation
end.
------------------------
DLL过程
....
Procedure Operator(UG_PubVar:TPubVar);stdcall;
var
FMOperator: TFMOperator;
implementation
uses UGlobal;
{$R *.dfm}
Procedure Operator(UG_PubVar:TPubVar);
begin
Application.Handle:=UG_PubVar.AppHandle;
UGlobal.UG_PubVar:=UG_PubVar;
with TFMOperator.Create(Application) do
try
ShowModal;
finally
Free;
end;
End;
---
申明调用过程(静态调用)
Procedure Operator(UG_PubVar:TPubVar);stdcall;external 'sysDLL.dll';
--------
----------------------------------------
向上面的过程有20~30个
在调用过程的次数多了程序关闭,进程中还有在运行中。
后来采用
//
begin
Application.Initialize;
UGlobal.UG_PubVar.AppHandle:=Application.Handle;
FMFalsh := TFMFalsh.Create(nil);
try
FMFalsh.Show;
FMFalsh.Update;
try
Application.CreateForm(TFMDMBase, FMDMBase);
Application.CreateForm(TFMMain, FMMain);
UGlobal.UG_PubVar.AppADOCNN:=FMDMBase.ADOCNN;
except
ShowMessage('数据库连接失败,'+#13#10+'确定连接后重试!');
Application.Terminate;
end;
FMFalsh.Update;
finally
FMFalsh.Free;
end;
try
if Landing then//登陆函数
Application.Run
finally
Application.Terminate;//[red]用该命令强制终止程序[/red]
end;
有没有其他的办法判断DLL是否释放
第二个问题
DELPHI帮助里的的一段代码,这段代码起什么作用,怎样使用他
library ??;
uses
SysUtils,
Classes,
var
SaveExit: Pointer;
procedure LibExit;
begin
... // library exit code
ExitProc := SaveExit
// restore exit procedure chain
end;
begin
... // library initialization code
SaveExit := ExitProc
// save exit procedure chain
ExitProc := @LibExit
// install LibExit exit procedure
end.