这有些资料,你看看?
var
DLLApp: TApplication;
DLLScr: TScreen;
Procedure CreateTool(App: TApplication; Scr: TScreen; var Reference); stdcall;
begin
Application := App;
Screen := Scr;
ToolFrm:= TToolFrm.Create(App);
SetToolEnable(False);
TComponent(Reference):= ToolFrm;
end;
procedure ExitDLL(Reason: Integer);
begin
if Reason = DLL_PROCESS_DETACH then
begin
Application := DLLApp;
Screen := DLLScr;
//OleUninitialize;
end;
end;
exports
CreateTool;
begin
DLLApp := Application;
DLLScr := Screen;
//OleInitialize(nil); //很重要,否则会抱错(尚未调用CoInitialize)
DLLProc := @ExitDLL;
end.