装载HYDRA插件
procedure THostForm.LoadLocalModules;
var
i, x : integer;
parentnode: TTreeNode;
controller : THYModuleController;
plugindescriptor : THYPLuginDescriptor;
begin
TreeView.Items.BeginUpdate;
with ModuleManager do
begin
LoadModules(GetAppPath + 'plugin/*.dll');
for i := 0 to (ModuleCount - 1) do
begin
controller := Modules[i].ModuleController;
if blTree(controller.Descriptor.Name) <> nil then
parentnode := blTree(controller.Descriptor.Name)
else
parentnode := TreeView.Items.AddChildObject(NIL,
controller.Descriptor.Name, controller);
for x := 0 to (controller.PluginDescriptorCount - 1) do
begin
plugindescriptor := controller.PluginDescriptors[x];
TreeView.Items.AddChildObject(parentnode,
plugindescriptor.Name, plugindescriptor);
end;
end;
end;
TreeView.Items.EndUpdate;
end;
本文来自博客园,作者:{咏南中间件},转载请注明原文链接:https://www.cnblogs.com/hnxxcxg/archive/2010/11/25/2940663.html