对不起,如果过去曾问过这个问题,但我很困惑!
我在 Delphi 中有一个应用程序和一个 DLL。Dll 有一个我想在 Groupbox 内显示的表单(无模式)。在主应用程序中,我启用了运行时包。如果我在 DLL 中禁用它们,则可以使用下面的代码。
在 DLL 中:
procedure showInfo(app : Thandle; GB : TGroupBox); stdcall;
begin
// application.Handle := app; // are the same
FormSysInfo := TFormSysInfo.CreateParented(GB.handle);
FormSysInfo.show;
end;
procedure destroyInfo; stdcall;
begin
FormSysInfo.destroy;
end;
exports showInfo index 1,
destroyInfo index 2;
在主应用程序中:
procedure loadSysInfo;
var showInfo : procedure(app : Thandle; GB : TGroupBox); stdcall;
begin
sysInfo := LoadLibrary('SysInfo.dll');
if sysInfo <> 0 then begin
@showInfo := GetProcAddress(sysInfo, 'showInfo');
@destroyInfo := GetProcAddress(sysInfo, 'destroyInfo');
if @showInfo <> NIL then showInfo(application.handle,mainForm.GroupBox8);
end;
end;
但没有显示我是否为 DLL 启用运行时包(我想减小大小)。请问我该如何处理?提前致谢