Einzelnen Beitrag anzeigen

Benutzerbild von chaosben
chaosben

Registriert seit: 27. Apr 2005
Ort: Görlitz
1.358 Beiträge
 
Delphi XE2 Professional
 
#4

AW: An die Profis nochmal Interface

  Alt 13. Mär 2011, 16:58
Also ich habs jetzt mal ausprobiert und die Variante 1 funzt bei mir ohne Probleme.

Delphi-Quellcode:
unit Unit29;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs;

type
  ISkinListBox = interface
    ['{38EF3B4F-86A1-45D0-A7F3-4E45E125979D}']
    function GetHandle: hWnd;
    property Handle: hWnd read GetHandle;
    procedure SetFont(nPointSize: Integer; FontName: PAnsiChar; AktForecolor: COLORREF;
      InAktForecolor: COLORREF; Shadow: Boolean; SOffset: Integer; ShadowColor: COLORREF);
    procedure InitTrackbar;
  end;

  TMyTest = class(TinterfacedObject, ISkinListBox)
  private
    function GetHandle: hWnd;
    property Handle: hWnd read GetHandle;
    procedure SetFont(nPointSize: Integer; FontName: PAnsiChar; AktForecolor: COLORREF;
      InAktForecolor: COLORREF; Shadow: Boolean; SOffset: Integer; ShadowColor: COLORREF);
    procedure InitTrackbar;
  public
    destructor Destroy; override;
  end;

  TForm29 = class(TForm)
    procedure FormCreate(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form29: TForm29;

implementation

{$R *.dfm}

procedure TForm29.FormCreate(Sender: TObject);
var
  slb : ISkinListBox;
begin
  slb := tMYTest.Create;
  slb := nil;
end;

{ TMyTest }

destructor TMyTest.Destroy;
begin
  asm int 3; end;
  inherited;
end;

function TMyTest.GetHandle: hWnd;
begin

end;

procedure TMyTest.InitTrackbar;
begin

end;

procedure TMyTest.SetFont(nPointSize: Integer; FontName: PAnsiChar;
  AktForecolor, InAktForecolor: COLORREF; Shadow: Boolean; SOffset: Integer;
  ShadowColor: COLORREF);
begin

end;

end.
Benjamin Schwarze
If I have seen further it is by standing on the shoulders of Giants. (Isaac Newton)
  Mit Zitat antworten Zitat