简单的任务: 我想制作一个程序(parent.exe)。有三个按钮。当我单击Button1时,Form1出现;当Button 2,Form 2出现时;当Button3,Form3出现时...Can Dll可以为主程序提供模块性吗?
Form1,Form2,Form3存储在三个不同的DLL(Form1dll.dll,Form2dll.dll,Form3dll.dll)中。
我想让父程序(parent.exe)运行模块化。我计划添加和删除dll,但Parent.exe需要所有dll都存在,否则发生异常。
我该如何解决问题?
感谢名单
下面是从parent.exe代码:
procedure ShowForm1;stdcall;external 'Project1dll.dll' name 'ShowForm1';
procedure ShowForm2;stdcall;external 'Project2.dll' name 'ShowForm2';
procedure ShowForm3;stdcall;external 'Project3.dll' name 'ShowForm3';
var
ParentForm: TParentForm;
implementation
{$R *.DFM}
procedure TParentForm.Button1Click(Sender: TObject);
begin
ShowForm1;
end;
procedure TParentForm.Button2Click(Sender: TObject);
begin
ShowForm2;
end;
procedure TParentForm.Button3Click(Sender: TObject);
begin
ShowForm3;
end;
您应该在尝试使用插件(JVPlugin或任何其他)之前启用运行时软件包。您必须从包中加载核心RTL/VCL类,而不是静态链接它们,以便在主应用程序及其插件之间共享所有核心共享类代码和数据结构的共同副本。 – 2009-12-30 15:06:17
是的,但只有当您使用BPL插件。也可以使用DLL。 – 2009-12-30 16:22:56