Show text representation of form

To solve this problem, use ObjectBinaryToText procedure, which converts the binary representation of an object into text.

procedure TForm1.Button1Click(Sender: TObject);
var
  Source: TResourceStream;
  Dest: TMemoryStream;
begin
  Source:=TResourceStream.Create(hInstance, 'TFORM1', RT_RCDATA);
  Dest:=TMemoryStream.Create;
  Source.Position := 0;
  ObjectBinaryToText(Source, Dest);
  Dest.Position := 0;
  Memo1.Lines.LoadFromStream(Dest);
end;