Request
The following script represents my problem.program test; uses Forms, StdCtrls; var fr : TForm; me: TMemo; begin fr := TForm.create(nil); try me := TMemo.create(fr); me.parent := fr; me.lines.clear; fr.showmodal; finally fr.free; end; end.
If I execute the script above I get error:
Object Project1.exe raised exception class Exception with message 'Class "TMemoStrings" is not registered.'.
It is produced, when I call »memo1.lines.clear«. I looked into StdCtrls.pas, and found TMemoStrings class declared under implementation section. It's not possible to register it outside unit. I'll be greatfull if you could find solution. I'm using Delphi 2007.
You have to use fake methods to register virtual abstract methods. For example:
procedure TStrings_Clear(Self: TStrings); begin self.Clear; end; .................................... G := RegisterClassType (0, TStrings); RegisterHeader (G, 'procedure Clear; ', @TStrings_Clear);