"Align property does not exist" when inheriting from TCustomControl

I created my own control inherited from TCustomControl and published the Align TControl property. But when I used this custom control in a C ++ Builder project, it threw an exception

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

This is the code for a 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. 
+7
source share
1 answer

Often this error occurs if the package was not properly rebuilt. Then you need to open the package project, which includes the "GameListCtrl" block, rebuild the package. Be sure to enable the option to enable RAD Studio to create C ++ Builder files.

If this does not help the linker, it may choose the wrong / old DCU or obj file. Find all your drives and delete all the GameListCtrl.dcu and GameListCtrl.obj files that you can find. I use JAM Software's UltraSearch to quickly search for local drives, which is much faster than Windows Search because it works directly on NTFS structures.

You can also try switching to static links for your project in the project settings.

+11
source

All Articles