关于DLL的初始化函数和退出函数
做一个DLL
由于里面申请了变量,所以想再退出时释放,但是了好几次不能调用
library CKY95H;
uses
SysUtils,
Classes,
Dialogs,
VoicePlayerThrd in 'VoicePlayerThrd.pas',
VoiceData in 'VoiceData.pas',
PubData in 'PubData.pas',
SysSetting in 'SysSetting.pas',
VoiceDataPhaser in 'VoiceDataPhaser.pas',
Comm in 'Comm.pas',
WavePlayer in 'WavePlayer.pas',
DLLExports in 'DLLExports.pas',
OldFunctions in 'OldFunctions.pas';
{$R *.res}
{$R SOUNDS.RES}
var
pSaveProc: Pointer;
//两个执行不到的函数
procedure MyExitProc;
begin
ShowMessage( 'Exit' );
end;
procedure MyDLLProc( Reason: integer );
begin
ShowMessage( 'DLLProc' );
end;
exports
dsbdll;
begin
ShowMessage( 'init' );//这里能执行
//退出指针
pSaveProc := ExitProc;
ExitProc := @MyExitProc;
DLLProc := @MyDLLProc;
end.
以前用过,都可以,现在怎么不可以了
我使用的
Borland Delphi 6.0
Windows XP + sp1
实在懒得用C重写了,各位大虾帮个忙