Question: I create my own class and I want to use it in my new component but I am getting an error...
The code is the following:

```
type
  TMyClass = class
    Name: string;
    Number: double;
  end;

  TMyComponent = class(TCustomPanel)
  private
    FMyClass: TMyClass;
  public
    procedure SetMyClass(aName: string; aNumber: double);
  published
    property MyClass: TMyClass write SetMyClass;
  end;

procedure SetMyClass(aName: string; aNumber: double);
begin
  FMyClass.Name:= aName;
  FMyClass.Number:= aNumber;
end;

```

it appears that the property has incompatible types, I don't know why.

Does anybody has a clue about that and how can I solve this problem.
Having a FName and FNumber as fields in TMyComponent is not an option, my code is more complex and this is a simple example to explain my goal.

thanks

Answer: 
Try this:

```
type
  TMyClass = class
    Name: string;
    Number: double;
  end;

  TMyComponent = class(TCustomPanel)
  private
    FMyClass: TMyClass;
  public
    procedure SetMyClass(Value: TMyClass);
  published
    property MyClass: TMyClass write SetMyClass;
  end;

procedure TMyComponent.SetMyClass(Value);
begin
  FMyClass := Value;
end;

```
```
unit MyComponentTest2;

interface

uses SysUtils, Classes, Controls, Forms, ExtCtrls, Messages, Dialogs;

type
  TMyClass = class
    Name: string;
    Number: double;
  end;

  TMyComponentTest2 = class(TCustomPanel)
  private
    FMyClass: TMyClass;
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;

    procedure SetMyClass(Value: TMyClass);
  published
    property MyClass: TMyClass read FMyClass write SetMyClass;
  end;

procedure Register;

implementation

constructor TMyComponentTest2.Create(AOwner: TComponent);
begin
  Inherited Create(AOwner);
  FMyClass:= TMyClass.Create;
end;

destructor TMyComponentTest2.Destroy;
begin
  Inherited;
  FMyClass.Free;
end;

procedure TMyComponentTest2.SetMyClass(Value: TMyClass);
begin
  FMyClass.Name:= Value.Name;
  FMyClass.Number:= Value.Number;
end;

procedure Register;
begin
  RegisterComponents('MyComponents', [TMyComponentTest2]);
end;

end.

```