vb6

Why does the VB6 IDE crash when opening a form?


The question is - why is my VB6 IDE crashing (all of a sudden) and how can I fix it?

VB6 had been operating on this PC, normally, for months if not years before this first began. The problem appeared to arise spontaneously.

Here's all the information I have to describe the issue...

Scenario:

  1. Run VB6 - either by double clicking a project (VBP) file, or from it's icon / Start menu
  2. Load a project
  3. Try to open any form or code module
  4. IDE instantly crashes with an error message such as:

An unhandled win32 exception occured in VB6.EXE [XXXX].

Allowing Windows to open the debugger, it shows the fault occurring on this line:

004581F1 mov ecx,dword ptr [eax]

And in the Windows event log, it shows this:

 Problem Event Name:    APPCRASH
 Application Name:  vb6.exe
 Application Version:   6.0.97.82
 Application Timestamp: 403acf6c
 Fault Module Name: vb6.exe
 Fault Module Version:  6.0.97.82
 Fault Module Timestamp:    403acf6c
 Exception Code:    c0000005
 Exception Offset:  000afa89
 OS Version:    6.2.9200.2.0.0.256.48
 Locale ID: 1033
 Additional Information 1:  a239
 Additional Information 2:  a239f58f940977df1cec7176d1176bff
 Additional Information 3:  ef99
 Additional Information 4:  ef9908a42708e3d51b1220b5874297f1

O/S: Win7 64 bit

Note 1 - I think this is a different issue than this question: VB6 crashes after build, because the scenario to cause the crash is different.

Note 2 - I have seen a few signs of this problem elsewhere. Both here and here include some similar information, but no apparent solution.


Solution

  • Ultimately I found that I needed to reset the compatibility settings of VB6.exe.

    Specifically:

    1. Go to C:\Program Files (x86)\Microsoft Visual Studio\VB98
    2. Right click vb6.exe, right click, and select Properties
    3. Select Compatibility tab
    4. Mine was already set to run in Win XP compatibility mode. Uncheck this.
    5. Close properties.
    6. Run the EXE. Still not fixed.
    7. Open properties. Set Win XP compat again.
    8. Run VB6. Open project. Open form. No crash.

    Note that rebooting, reinstalling VB6 and the latest service pack, etc. had no effect on this issue, all of which I tried before stumbling into this solution.