Why does the VB6 IDE crash when opening a form? - vb6

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:
Run VB6 - either by double clicking a project (VBP) file, or from it's icon / Start menu
Load a project
Try to open any form or code module
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 signature:
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.

Ultimately I found that I needed to reset the compatibility settings of VB6.exe.
Specifically:
Go to C:\Program Files (x86)\Microsoft Visual Studio\VB98
Right click vb6.exe, right click, and select Properties
Select Compatibility tab
Mine was already set to run in Win XP compatibility mode. Uncheck this.
Close properties.
Run the EXE. Still not fixed.
Open properties. Set Win XP compat again.
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.

Related

JetBrains IDE Error on start : The application was unable to start correctly (0xc000007b)

I have got this error, but hardly could find the solution after 2 times reinstalling my IDE and even I installed 'All in One runtimes' but it couldn't help since I think the problem originally started after I changed few settings in windows defender setting and then tried to reset them.
But sure others have reported this problem and had no idea of what had happend all of a sudden to get following error when trying to run the application:
JetBrains IDE Error on start : The application was unable to start correctly (0xc000007b)
The application was unable to start correctly (0xc000007b)
*1 - which in my case was Phpstorm64.exe running on windows 10
I just felt there is no 'easy to find' solution for this occurring problem, so I decided to post it on Stackoverflow
In my case this was helpful and worked for me:
just disable ASLR (Address space layout randomization) from windows defender
in Windows 10 you should follow these steps:
open Settings (just right-click on windows start and choose
settings)
search for 'Windows Defender Settings' or just go to 'Update & Security' > 'Windows Security'
then open 'App & browser control', in the new opened window scroll down to the end to find 'Exploit protection settings', click
that
sort of settings will be shown and you can change the default settings. to create an exception you should click "Program settings"
(which doesn't seem to be a button,but it is!)
click 'add program to customize', in the dialog enter your ide name.exe (you can easily find it by clicking 'open file location' on
shortcut of the application)
in my case the application name was 'phpstorm64.exe'
next you have to look for 'force randomization for images (Mandatory ASLR)' check the 'override system settings' and switch it off and apply settings.
I'm not sure if it's needed,but turning off 'Randomize memory allocations (Bottom-up ASLR)' stated to work for others
I would appreciate if you help to get a complete solution for this problem , thanks
The crash is probably caused by ASLR Windows feature, the relevant ticket in the JetBrains issue tracker: IDEA-184029
Please check if the following workaround:
Turn the feature off globally or for a specific executable path https://learn.microsoft.com/en-us/microsoft-365/security/defender-endpoint/customize-exploit-protection
helps

VB6 application won't run in some computers, in others it runs fine

I have a VB6 application, the installer is compiled using INNO Setup.
The installer runs fine. But in about 10% of computers when the user clicks the Icon to run the installed app, it doesn't start, no error message, only a Beep sound.
This is happening on XP and also Win 7.
I develop in XP and Win 7 and the application works OK, so I haven't been able to reproduce the issue.
The installer registers all ocx and dlls needed (afaik). (Well not completely all, it assumes MS run-time components should be there, but I guess an error message should show up if something is missing)
I was thinking some kind of user permissions, UAC, but even users in the admin group have had the issue.
Could you point me to what possible issues to look for and test in order to patch the app.
Thanks!
[FOLLOW UP]
Thanks to the tips, found out the manifest is causing the problem. I use it to make the controls look better:
http://www.vbaccelerator.com/home/vb/code/libraries/xp_visual_styles/using_xp_visual_styles_in_vb/article.asp
Now I'm trying to discover why. I have another application with the same manifest and that one works ok.
Haven't been able to get feedback on the event viewer yet.
The "beep crash" often points to an error in an application manifest such as an XML syntax error or namspace conflict. Event Logs will often provide a hint about this.
But I've found that people often try to use the Common Controls 6.0 Library without ensuring proper library loading sequence.
Before any Forms are openend you should load shell32 and then comctl32. The easiest way is a couple of no-op calls in Sub Main:
Option Explicit
Private Declare Sub InitCommonControls Lib "comctl32" ()
Private Declare Function IsUserAnAdmin Lib "shell32" () As Long
Private Sub InitCommonControlsVB()
IsUserAnAdmin
InitCommonControls
End Sub
Private Sub Main()
InitCommonControlsVB
Form1.Show
End Sub
Without this your program will usually work fine in Vista or Win7, but will fail on some XP service pack and patch levels. Part of this is due to changes over time in the Fusion subsystem that handles SxS activation and comctl32.dll patches.
Ignore those saying you need to call InitCommonControlsEx(), it isn't necessary unless you are constructing and using Win32 controls directly instead of VB6 and COM controls.
A few things to try to narrow it down:
Check the Windows Event Log for crash events
Check the Windows Event Log (in the Application section) for crash reports from your application. You can quickly get to the log viewer on Windows XP by clicking Start > Run, typing eventvwr and pressing Enter. On Windows 7, you can type "event viewer" in the search box that is in the Start menu. You can filter the events to only show error events from your program.
You might find a few error events on one of the computers where this problem has already occured, because it sounds like the error reporting feature is turned off on these computers (in which case "hard crashes" like access violations are logged in the Event Log instead of displaying an error dialog to the end-user, as long as a debugger isn't installed on the computer).
Make sure "Error Reporting" is turned at the OS level
As mentioned in the previous section, it sounds like the error reporting feature is turned off on these computers. In that case, a crash won't display any kind of message to the end-user at all and the application will just vanish suddenly. In Windows XP, you can check this setting (and turn it on) as follows:
Right-click "My Computer" and select Properties.
Open the Advanced tab and click the Error Reporting button.
Select the Enable Error Reporting option.
Click OK to all the open windows.
Add trace code to your application
You could also add some trace code to your application's start-up code, such as code to display a message box or write a message to the Windows Event Log or to a log file as soon as your application starts (for example, in the Form_Initialize event of your main form, or in a Sub Main routine).
This way you will be able to tell whether your application is crashing before or after the VB6 runtime is loaded: if you try to start the application and it disappears/crashes, and your startup message isn't logged, then you know it's crashing before it even has a chance to get to your application's startup code, which could indicate that a dependency of the VB6 runtime or the VB6 runtime itself is not installed properly.
Note that Windows XP and Windows 7 both ship with the VB6 runtime pre-installed, but it's possible for misbehaving installers to overwrite or remove files that are part of the VB6 runtime.

Using GlobalFlags to call vsjitdebugger with VS2010

I've upgraded to Win7 and VS2010. Previously on Win2K and VS2008, I used GlobalFlags to debug an application on startup, simply by setting it's debugger to vsjitdebugger - see the screenshot below. Unfortunately, this doesn't work on my current setup - a google and search of SO haven't turned up any answers.
Thanks in advance.
UPDATE: Forgot to mention that my global flags settings do seem to have some effect - running my command on the command line causes Windows to say the program has crashed - it works just fine without the global flags. This is leading me to think my command line for the debugger is incorrect - but that's just a guess. I'd be interested in hearing from anyone who's got this to work.
alt text http://img825.imageshack.us/img825/3538/55489547.png
Running the 64-bit version of Windows 7? Using the 32-bit version of gflags.exe?
You can also edit the registry directly. An example .reg file for notepad.exe:
REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe]
"Debugger"="vsjitdebugger.exe"
Run the VS2010 on Win7 with administrator privilege, "vsjitdebugger.exe" works fine.
It looks like there's an extra step in Win7 which I wasn't expecting - it throws up a "MyProgram has stopped working" screen first. If you look at the details, it says it's an application crash.
You get the options:
"Check online for a solution and close the program"
"Close the program"
"Debug the program"
Clicking debug then pops up the vsjitdebugger dialog and all is well.

Visual Studio cannot find debuggerutils.h

I've installed Visual Studio 15.9.0, Preview 3 and created a project using the new platform support for C++/winrt. The project runs fine until I set a breakpoint. When the break is hit VS tells me "You need to find debuggerutils.h to view the source for the current call stack frame" It tells me this file was originally at onecore\com\combase\inc\debuggerutils.h, though it doesn't tell me the path to onecore. Search can't find such a file. Does anyone know how to find that file or install it? I had just assumed that VS would automatically include debugging capability.
[Update] Appears it is not the setting of a breakpoint but a bug causing a break before that. But I'm still mystified by the error message.
Someone asked this question on github's WinObjC issues:
https://github.com/microsoft/WinObjC/issues/2931
From the discussion:
edvv commented on Nov 22, 2019
Ah, now I remember what this means: "This is a false message. What really happened is that your app silently terminated (maybe by a console abort(), i.e.: crashed ) and when the app failed to launch (aborted) the front end gave that message. You need to look at the Windows Console window in VS while in debug mode."

Vista BEX error

Recently I got IE7 crashed on Vista on jar loading (presumably) with the following error:
Problem signature:
Problem Event Name: BEX
Application Name: iexplore.exe
Application Version: 7.0.6001.18000
Application Timestamp: 47918f11
Fault Module Name: ntdll.dll
Fault Module Version: 6.0.6001.18000
Fault Module Timestamp: 4791a7a6
Exception Offset: 00087ba6
Exception Code: c000000d
Exception Data: 00000000
OS Version: 6.0.6001.2.1.0.768.3
Locale ID: 1037
Additional Information 1: fd00
Additional Information 2: ea6f5fe8924aaa756324d57f87834160
Additional Information 3: fd00
Additional Information 4: ea6f5fe8924aaa756324d57f87834160
Googling revealed this sort of problems is common for Vista and relates to Java (although SUN negates). Also I think it has something to do with DEP. I failed to find official Microsoft Kb.
So, the questions are:
What BEX stands for?
What is it about?
How to deal with such kind of errors?
BEX=Buffer overflow exception. See http://technet.microsoft.com/en-us/library/cc738483.aspx for details. However, c000000d is STATUS_INVALID_PARAMETER; the technet article talks primarily about status c0000005 or c0000409 (access violation/DEP)
Java and IE7 do not like to play together nicely. Just turn off DEP, it will work fine then.
http://www.tech-recipes.com/rx/1261/vista_disable_dep_noexecute_protection_fix_explorer_crashing/
go to internet explorer options/ advanced /security/ uncheck the box that says enable memory protection to mitigate attacks this will work it did for me
go to internet explorer options/ advanced /security/ uncheck the box that says enable memory protection to mitigate attacks this will work it did for me
Most likely there is an addon that is messing with IE.
You can try this.
1. Open IE
2. Switch to the Advanced tab.
3. Click the Reset Internet Explorer Settings button.
4. Click Reset to confirm the operation.
5. Click Close when the resetting process finished.
6. Uncheck Enable third-party browser extensions option in the Settings box.
7. Click Apply, click OK.
After this, check to see if it works and if it does, enable one addon at a time until you find the culprit. Then uninstall it and reinstall it if you need it.
just try disabling the bing or msn toolbar - should do the trick.

Resources