GetInterfaceProp raises exception
Original Reporter info from Mantis: Imants
-
Reporter name: Imants
Original Reporter info from Mantis: Imants
- Reporter name: Imants
Description:
When I try to get published interface property it raises Excception
Steps to reproduce:
unit Unit1;
{$mode delphi}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
typinfo;
type
{ TForm1 }
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
{ TTest }
TTest = class
private
function GetX: IUnknown ;
published
property X: IUnknown read GetX;
end;
var
Form1: TForm1;
implementation
{ TTest }
function TTest.GetX: IUnknown;
begin
Result := TInterfacedPersistent.Create;
end;
{$R *.lfm}
{ TForm1 }
procedure TForm1.FormCreate(Sender: TObject);
var
V: IUnknown;
FT: TTest;
begin
FT := TTest.Create;
V := GetInterfaceProp(FT, 'X');
end;
end.
Mantis conversion info:
- Mantis ID: 21684
- OS: windows
- OS Build: windows 7
- Build: 35589
- Version: 2.7.1
- Fixed in version: 3.0.0
- Fixed in revision: 20857 (#4c472a15)