For anyone who is left to wallow in the suck that is legacy VB6 programming, like I am, hopefully this will be of help to you.

I recently switched to a new machine at which point I pulled down all of the source code from our Mercurial repositories so I could start working.  One of these projects is an old VB6 app that I wrote (and would deperately love to port to .NET).  Not a problem, I thought.  All of the changes were pushed to the central repository prior to me switching machines so everything should be great.

Wrong.  When trying to open the project I was presented with the lovely "Errors during load.  Refer to [insert path to form file here] for details" error:

VB6 Form Load Error - Errors during load

This was immediately followed by the "[path to form file" could not be loaded--Continue Loading Project?" prompt:

VC6 Form Load Error - could not load form, continue loading project?

One pair of prompts for each form file in my project.  After dismissing this for all form files (clicking Ok in the first prompt and Yes in the second) the project loaded but there was no Forms folder.  Lovely.

Web searches for the error revealed nothing overly useful, except for a post that said that often this is a problem in the formatting of a form file.  That lead me to have a look at one of the .frm files in Notepad++ with the Show All Characters option turned on.  What I noticed right away was that all lines were terminated not with the Windows standard CRLF, but rather with just a plain LF.  Thank you Mercurial, but that's a different post.

So since I was in Notepad++ I just used the EOL Conversion function (under the Edit menu) which has Windows selection that when chosen converts all EOL sequences in the file to CRLF.  Saved the file, cleared all the form error logs in the VB6 project folder, reloaded the project and the forms came right up.






Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.