AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Object-Pascal / Delphi-Language E2232 Interface 'x' besitzt keine Interface-Identifikation?
Thema durchsuchen
Ansicht
Themen-Optionen

E2232 Interface 'x' besitzt keine Interface-Identifikation?

Ein Thema von Whookie · begonnen am 20. Jul 2015 · letzter Beitrag vom 20. Jul 2015
 
Whookie

Registriert seit: 3. Mai 2006
Ort: Graz
441 Beiträge
 
Delphi 10.3 Rio
 
#1

E2232 Interface 'x' besitzt keine Interface-Identifikation?

  Alt 20. Jul 2015, 12:40
Delphi-Version: XE8
Hänge gerade an einem Interface - Problem und verstehe nicht wieso ich den E2232 Fehler (oder im Alternativfall kein Interface bekomme)!

Folgendes leeres Delphi VCL Projekt (leere Form):
Delphi-Quellcode:
unit Unit2;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs;

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

var
  Form2: TForm2;

implementation

{$R *.dfm}


Const
  MyIntfAGuid: TGuid = '{23D5751F-8368-4672-ACFC-3BF667F1F544}';

Type
  IMyIntfA = Interface
    [MyIntfAGuid]
    procedure foo;
  End;


  TMyClass = Class(TInterfacedObject, IMyIntfA)
    procedure foo;
  End;



{ TMyClass }

procedure TMyClass.foo;
begin
end;

procedure TForm2.FormCreate(Sender: TObject);
var
  LMy: TMyClass;
  LIMyA: IMyIntfA;
  x: Integer;
begin
  LMy := TMyClass.Create;

  // so gibts E2232
  if Supports(LMy, IMyIntfA) then
  begin
    x := 3;
  end;

  // so gibts kein Interface
  if LMy.QueryInterface(MyIntfAGuid, LIMyA) = S_OK then
  begin
    x := 3;
  end;


  LMy.Free;
end;

end.

Irgendwas mache ich offensichtlich falsch....?
Whookie

Software isn't released ... it is allowed to escape!
  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 00:18 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz