[DUG] Error loading form

Errol Anderson errol.anderson at gsds.co.nz
Wed Jan 24 14:09:51 NZDT 2018

Hi Karl


Thanks for the conversion code – however, my dfm is text, sorry I did not confirm this earlier.  I have reviewed the dfm – all 12,000+ lines but nothing obvious.  I believe the cause of the form-loading error is more subtle than a detectable error in the dfm text, as the program compiles and displays the form.  What puzzles me is that I have reverted to versions from the _history folder which were previously working correctly, and still get the error. 








From: Karl Reynolds [mailto:kreynolds at chocfishsoft.co.nz] 
Sent: Tuesday, 23 January 2018 4:05 PM
To: NZ Borland Developers Group - Delphi List <delphi at listserver.123.net.nz>
Subject: Re: [DUG] Error loading form


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


  LMemoryStream := TMemoryStream.Create;


  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);










On Tue, Jan 23, 2018 at 2:31 PM, Errol Anderson <errol.anderson at gsds.co.nz <mailto: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 Anderson 

Geothermal Resource Analyst | Software Development

GSDS Ltd        <http://www.gsds.co.nz/> www.gsds.co.nz

Mob: +64 (0)21 181 3367 <tel:+64%2021%20181%203367> 

Email:    errol.anderson at gsds.co.nz <mailto:errol.anderson at gsds.co.nz> 

Skype: errol_anderson


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 <mailto: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 <http://net.nz>  with Subject: unsubscribe


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20180124/f5fab148/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 2504 bytes
Desc: not available
Url : http://listserver.123.net.nz/pipermail/delphi/attachments/20180124/f5fab148/attachment.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 4499 bytes
Desc: not available
Url : http://listserver.123.net.nz/pipermail/delphi/attachments/20180124/f5fab148/attachment.jpe 

More information about the Delphi mailing list