一个例子: function QueryExit(Caption:string):boolean; var FormDll:THandle; moExitDlg : function (Caption:pchar ):integer;stdcall; begin result:=False; FormDll:=LoadLibrary('Form.dll'); if FormDll=0 then raise Exception.Create('Can not Load Form.dll'); try @moExitDlg := GetProcAddress( FormDll,'moExitDlg'); if @moExitDlg=nil then raise Exception.Create('Can not load function moExitDlg of Form.dll'); Result:=moExitDlg(pchar(Caption))=IDOK; finally FreeLibrary(FormDll); end; end; 另外:不建议你用一个帖子问多个问题 你要是用过搜索你就知道为什么了。
function QueryExit(Caption:string):boolean;
var
FormDll:THandle;
moExitDlg : function (Caption:pchar ):integer;stdcall;
begin
result:=False;
FormDll:=LoadLibrary('Form.dll');
if FormDll=0 then
raise Exception.Create('Can not Load Form.dll');
try
@moExitDlg := GetProcAddress( FormDll,'moExitDlg');
if @moExitDlg=nil then
raise Exception.Create('Can not load function moExitDlg of Form.dll');
Result:=moExitDlg(pchar(Caption))=IDOK;
finally
FreeLibrary(FormDll);
end;
end;
另外:不建议你用一个帖子问多个问题
你要是用过搜索你就知道为什么了。