AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Problem Mit Interface-Objekt

Ein Thema von DGS · begonnen am 26. Apr 2007 · letzter Beitrag vom 27. Apr 2007
 
DGS

Registriert seit: 10. Jul 2004
65 Beiträge
 
Delphi 6 Enterprise
 
#4

Re: Problem Mit Interface-Objekt

  Alt 26. Apr 2007, 16:22
OK, dann mal her mit dem code ^^"

Das ist meine Unit, die die Objekte sammelt:
Delphi-Quellcode:
unit SteuerEinheit;

interface

uses
  Interface_Haupt, Beispiel1;

type
  tSteuerEinheit = class
  private
    fAppletArray : array[0..5] of iHaupt;

  public
    constructor Create;
    procedure MainLoop;
  end;

var
  hlp : iHaupt;

implementation

uses
  Unit1;

constructor tSteuerEinheit.Create;
begin
  inherited Create;

// fAppletArray[0] := tBeispiel1.Create;
  hlp := tBeispiel1.Create;
end;

procedure tSteuerEinheit.MainLoop;
begin
  hlp.MainLoop;
end;

end.
> funktioniert erst dann, wenn ich hlp auf tBeispiel1 ändere.

Hier das Interface:
Delphi-Quellcode:
unit Interface_Haupt;

interface

type
  iHaupt = interface
    procedure MainLoop;
  end;

implementation

end.
Es ist derzeit noch recht leer. Sollte aber später mit Funktionen aufgefüllt werden. Ich wollte bloss vorher testen, ob der Rohbau funktioniert, was er nicht tut.

und hier meine Beispiel Unit
Delphi-Quellcode:
unit Beispiel1;

interface

uses
  Interface_Haupt;

type
  tBeispiel1 = class(tInterfacedObject, iHaupt)
  private
  public
    constructor Create;

    procedure MainLoop;
  end;

implementation

constructor tBeispiel1.Create;
begin
  inherited Create;
end;

procedure tBeispiel1.MainLoop;
begin
  // TODO: MainLoop
end;
Wegen der Speicheradresse: war nicht 0.
Vorschläge für sinnvolle Signatur bitter per PN
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 02:26 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz