装载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;

你可能感兴趣的:(插件)