[DUG] Error loading form
Karl Reynolds
kreynolds at chocfishsoft.co.nz
Tue Jan 23 16:05:09 NZDT 2018
If your form is a binary form (as David said, text is recommended because
of situations like this), you can convert it to text by creating a new form
with a button that uses ObjectBinaryToText.
LMemoryStream := nil;
LFileStream := nil;
LMyForm := TMyForm.Create; // TMyForm is the form you want a text version of
try
LMemoryStream := TMemoryStream.Create;
LMemoryStream.WriteComponent(LMyForm);
LMemoryStream.Position := 0;
LFileStream := TFileStream.Create('c:\yourformname.dfm'); // or wherever
you want to put it and whatever you want to call it
ObjectBinaryToText(LMemoryStream, LFileStream);
finally
LMemStream.Free;
LFileStream.Free;
LMyForm.Free;
end;
Cheers,
Karl
On Tue, Jan 23, 2018 at 2:31 PM, Errol Anderson <errol.anderson at gsds.co.nz>
wrote:
> After a (worrying) computer crash, it appeared that my main form,
> main.pas, was corrupted. So I reverted to main.pas and main.dfm which I
> had committed to the git server last night.
>
>
>
> Now when I open the project or the main form using Delphi XE10.1, I get
> the following error, and I cannot display the form on pressing F12.
>
>
>
>
>
> However, the program compiles and displays the form when I run it, so it
> looks like main,dfm is substantially OK.
>
>
>
> Any ideas how I can retrieve the form would be most welcome.
>
>
>
> Thanks and regards
>
>
>
> Errol
>
>
>
> Errol Anderson
>
> Geothermal Resource Analyst | Software Development
>
> GSDS Ltd www.gsds.co.nz
>
> Mob: +64 (0)21 181 3367 <+64%2021%20181%203367>
>
> Email: errol.anderson at gsds.co.nz
>
> Skype: errol_anderson
>
>
>
> [image: Logo_final2_90]
>
> This communication and any attached material contains confidential
> information intended only for the use of the addressee named above. No
> confidentiality is waived or lost by any mistaken transmission to you. If
> you have received this message in error please delete the document and
> notify us immediately.
>
>
>
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at listserver.123.net.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at listserver.123.net.nz with
> Subject: unsubscribe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20180123/14263ed5/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.jpg
Type: image/jpeg
Size: 4499 bytes
Desc: not available
Url : http://listserver.123.net.nz/pipermail/delphi/attachments/20180123/14263ed5/attachment.jpg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 2504 bytes
Desc: not available
Url : http://listserver.123.net.nz/pipermail/delphi/attachments/20180123/14263ed5/attachment.png
More information about the Delphi
mailing list