BUG: INVALID FILE FORMAT ERROR WHEN RUN VB APP'S EXE FILE     Q101261    
---------------------------------------------------------------------
The information in this article applies to:

- The Microsoft Visual Basic programming system for Windows, version 3.0
---------------------------------------------------------------------

SYMPTOMS
--------
You may encounter the following error when running a Visual Basic
executable (EXE) file:

   Invalid file format

Or you may encounter the following error when loading a Visual Basic
project or form:

   Error loading '<form filename>'. A control could not be loaded due
   to a load error. Continue?

CAUSE
-----
This problem will occur when you have installed a new version of a
custom control and the internal property list of the control has
incorrectly changed in a way that breaks backward compatibility.

This problem is known to occur when you have installed the Visual
Basic version 3.0 GRID.VBX file over an earlier version of the grid.
Specifically, the problem will occur for an existing Visual Basic
application, built using a previous version of the grid, that sets the
HelpContextID property of the grid.

In the case where the problem occurs when you load a project into
Visual Basic that contains a grid, the problem will only occur when
the form file(s) containing the grid have been saved in binary format.

This problem is also known to occur when using Visual Basic version
2.0 and the CMDIALOG.VBX control. For more information on this problem,
query on the following words in the Microsoft Knowledge Base:

VBASIC and PROF and DEMO and CMDIALOG.VBX and INVALID and FILE and FORMAT

WORKAROUND
----------
There are several ways that you can work around this problem:

If you are using a Visual Basic version 3.0 application and you encounter
this problem, you can:

 - Acquire an updated copy of GRID.VBX from Microsoft. The grid (GRID.ZIP)
   is available in the MSBASIC forum on CompuServe in LIB 5.

 - Replace the Visual Basic version 3.0 of GRID.VBX with an earlier
   version. A disadvantage of this strategy is that applications requiring
   the Visual Basic version 3.0 grid will not run.

If you are a developer of a Visual Basic version 3.0 application that uses
the grid, you can:

 - Acquire an updated copy of GRID.VBX from Microsoft. The grid (GRID.ZIP)
   is available in the MSBASIC forum on CompuServe in LIB 5. You will need
   to build your application using this grid.

 - Rename GRID.VBX to a different name such as MSGRID3.VBX and rebuild the
   application using the renamed grid. A disadvantage of this strategy is
   that the grid will not be automatically updated when a new version of
   the grid (such as a version of the grid containing bug fixes) is
   released.

The following shows the date, time, size, and version number of the
GRID.VBX file that leads to this problem:

  Date: 28-APR-1993
  Time: 12:00 a.m.
  Size: 44667
  Version: Not Marked

The following shows the date, time, size, and version number of the
GRID.VBX file that fixes this problem:

  Date: 15-JUNE-1993
  Time: 5:26 p.m.
  Size: 45136
  Version: 03.00.0538

STATUS
------
Microsoft has confirmed this to be a bug in the Microsoft
   Visual Basic programming system for Windows, version 3.0

More Information:

Steps to Reproduce Problem
--------------------------
1. Start Visual Basic or from the File menu, choose New Project (ALT, F, N)
   if Visual Basic is already running. Form1 is created by default.

2. Add a Visual Basic version 1.0 or 2.0 version of GRID.VBX to Form1.

3. Put a grid control (Grid1) on Form1

4. Set the HelpContextID property of Grid1 to 1 (or some non-zero value).

5. From the File menu, choose Make EXE File (ALT, F, K) and create an EXE
   called PROJECT1.EXE.

6. Replace the older version of grid with the Visual Basic version 3.0
   version of GRID.VBX, which has a date and time of 28-APR-1993 12:00 am.

7. Run the PROJECT1.EXE file created in step 5.

You should encounter an "Invalid file format" error. If you replace the
Visual Basic version 3.0 grid with the version of the grid used in Step 2
and re-run PROJECT1.EXE, the program should run correctly.


