Thema: Delphi Hydra 3.0 Plugin

Einzelnen Beitrag anzeigen

Benutzerbild von Luckie
Luckie

Registriert seit: 29. Mai 2002
37.621 Beiträge
 
Delphi 2006 Professional
 
#13

Re: Hydra 3.0 Plugin

  Alt 17. Sep 2007, 15:52
Hm, da hab eich noch eine Lücke irgendwo.
Interface:
Delphi-Quellcode:
type
  IPluginInterface = interface(IHYVisualPlugin)
    ['{D728C6B3-837B-4D40-AE99-A8FBD71D7CE8}']
    function GetName: String;
    function GetVersionString: String;
    function GetVersionMajor: Cardinal;
    function GetVersionMinor: Cardinal;
    function GetAuthor: String;
    function GetComment: String;
    function GetDescription: String;
  end;

  IHostInterface = interface
    ['{1BA2CA86-4EED-411C-ABA1-D1BD1F6B3E96}']
    function GetID: Cardinal;
  end;
Host:
Delphi-Quellcode:
type
  TMainForm = class(TForm, IHostInterface)
    HYModuleManager1: THYModuleManager;
    pnlPluginArea: TPanel;
    btnLoadPlg: TButton;
    btnUnloadPlg: TButton;
    Memo1: TMemo;
    procedure btnUnloadPlgClick(Sender: TObject);
    procedure HYHydraAction1Execute(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure btnLoadPlgClick(Sender: TObject);
  private
    { Private declarations }
    FPluginForm: IHYVisualPlugin;
    FPlugin: IPluginInterface;
    function GetID: Cardinal;
  public
    { Public declarations }
  end;

// ...;
// ...;

function TMainForm.GetID: Cardinal;
begin
  Result := 42;
end;
Plugin:
Delphi-Quellcode:
procedure THydraVisualPlugin.Button1Click(Sender: TObject);
begin
  ShowMessage(IntToStr((FHost as IHostInterface).GetID));
end;
Aber da bekomme ich eine AV. Im Plugin muss noch was fehlen.

Ich werde mir das Beispiel noch mal angucken, aber erst morgen, jetzt ist Feierabend.
Michael
Ein Teil meines Codes würde euch verunsichern.
  Mit Zitat antworten Zitat