Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / pas2js / 2021-12

serializing components

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

helioroots roots
function SaveComponent(AComponent: TComponent): string;
var
  VInput: TBytesStream;
  VOutput: TStringStream;
begin
  VInput := TBytesStream.Create(nil);
  VOutput := TStringStream.Create('');
  try
    VInput.WriteComponent(AComponent);
    VInput.Seek(0, soBeginning);
    ObjectBinaryToText(VInput, VOutput);
    Result := VOutput.DataString;
  finally
    VOutput.Free;
    VInput.Free;
  end;
end;

Function is working except for events... they are not serialized.... I believe the problem is in

Class function TObject.MethodName(aCode : Pointer) : String; -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/pas2js/attachments/20211219/a984ea13/attachment.htm>

Reply by email