Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'Property Align does not exist' when inheriting from TCustomControl

I have created a custom control inherited from TCustomControl and published the property Align of TControl. But, when I used this custom control in a C++Builder project, it raised the exception

Project Launcher.exe raised exception class EReadError with message 'Property Align does not exist'.

This is the code for the custom control.

unit GameListCtrl;

interface

uses
  SysUtils, Classes, Controls;

type
  TGameList = class(TCustomControl)
  private
  protected
    procedure Paint; override;
  public
    { Public declarations }
  published
    property Align default alLeft;
  end;

implementation

{ TGameList }

procedure TGameList.Paint;
begin
  inherited;
end;

end.
like image 388
UltimaWeapon Avatar asked May 27 '13 05:05

UltimaWeapon


1 Answers

Often this kind of error occurs if the package was not properly rebuilt. Then you need to open the package project that includes the unit "GameListCtrl" an rebuild the package. Make sure to activate the option to let RAD Studio create the C++ Builder files.

If that doesn't help the linker maybe picks a wrong / old DCU or obj file. Search all your drives and delete all GameListCtrl.dcu and GameListCtrl.obj files that you can find. I use UltraSearch from JAM Software to quickly search my local drives, it is much faster than Windows Search as it works directly on the NTFS structures.

You may also try to switch to static linking for your project in the project options.

like image 138
Joachim Marder Avatar answered Sep 25 '22 00:09

Joachim Marder