FireMonkey Component Execution Error

  

I tried to create a very simple component(Tgraph) using the FireMonkey platform (XE7). First of all I create two new classes:
1) TGraph (anchestor type TLayout);
2) TMyPlot1D(anchestor type Tpanel);
I saved two units and created a package called ‘MyPackage’. I compiled and Installed it in the “Samples” page. I opened a new Firemonkey project and drag and drop the TGraph instance in the form. Everything works well. At designtime,I can see the component as defined, and all the relevant units are visible from the main unit. The relevant code is in the following:

First Class

unit UMyPlot;

interface

uses
System.SysUtils, System.Classes, FMX.Types,
FMX.Controls, FMX.StdCtrls;

type
TMyPlot1D = class(TPanel)
private
{ Private declarations }
protected
{ Protected declarations }
public
{ Public declarations }
published
{ Published declarations }
end;

procedure Register;

implementation

procedure Register;
begin
RegisterComponents(‘Samples’, [TMyPlot1D]);
end;

end.

Second Class

unit UMyGraph;

interface

uses
System.SysUtils, System.Classes, FMX.Types, FMX.Controls, FMX.Layouts,
UMyPlot;

type
TMyGraph = class(TLayout)
private
Plot : TmyPlot1D;
public
constructor create(Aowner:TComponent); override;
end;

procedure Register;

implementation

procedure Register;
begin
RegisterComponents(‘Samples’, [TMyGraph]);
end;

constructor TMyGraph.create(Aowner: TComponent);
begin
inherited;
Plot := TMyPlot1D.Create(Self);
plot.Parent := Self;
end;

end.

The problem is shown when I try to run my application.
I got the following error:
“Exception EClassNotFound in module Project1.exe at 000A51FA. Class TmyPlot1D not Found”. The failed function seems to be the Application.RealCreateForms.

If I drag and drop only the TmyPlot1D instance, it works (of course) both in designtime and in runtime!

Any ideas?

Thanks in advance

Comments are closed.