visual studio application stopped working on windows 7 - visual-studio-2010

I have made an application in visual studio 2010 on a windows xp computer. When I compile the release version and run it on a windows xp computer, it runs fine.
When I on the other hand try to run it on windows 7 I get the "This program has stopped working" error message. Running the application in compatibility mode doesn't change anything. Can someone tell me what I can try to do?
Thanks.

With the information you provide, it might be a windows 7 vs xp problem or that you don't find any resource that you are looking for. If I were you I would:
Get sure that app was compiled by any cpu
Check windows error log to see if there is any message
Run app as administrator
Use error handling (try/catch) to see exceptions by showing them in UI or logging to a text file.
EDITED: TRY-CATCH example
Try
//CODE
Catch ex As Exception
Dim writer As New StreamWriter("C:\MyLog.log", True, System.Text.Encoding.ASCII)
writer.WriteLine(ex.Message)
writer.Close()
End Try

I ran across this issue also. As my solution was completely different, I thought I would share just in case someone else found it relevant.
My problem was that in my project references I had two references to Adobe Acrobat DLL files. I was getting the error on my new client machine because it didn't have Adobe Reader installed (which installs the DLL's that my project references). Once I installed Adobe Reader, my program installed properly.
The interesting part of debugging this is that no TRY/CATCH block would have caught it. Apparently the check for reference happens before the code is run. You literally just get the generic message "ProgramName has stopped working".
Just FYI...

Related

An Innoscript won't start after having been downloaded from a server

I have an Inncoscript that works fine when I start it from my PC harddrive. But when it is downloaded from a server by a web site, it gives the following error message: "This app can't run on your PC." The strange thing is that it has worked before, some months ago. I have not registered the program Innoscript is supposed to launch at Microsoft yet, because it costs a lot of money and because it still is in the testing phase. I get warnings and am asked if I really want to run the Innoscript program. After clicking yes, the error message occur. The actual program to be launced is made in C by Visual Studio, and I am using Windows 10.
Thanks in advance.
I found the solution. The path had been changed.

VC++ app fails to start — but there's no error

I made a minor change to a legacy Visual C++ / MFC app built with VS 2008. I changed some UI resources in the .rc file and compiled without any problems, then deployed it on my client's system. However, the program which was previously doing fine now fails to run on exactly one of their servers. It works fine on my laptop and on their other servers, many of whom are basically identical to the one having the trouble.
The weird thing however is that there is absolutely no error message whatsoever. No message box, no errorlevel set (when run on command prompt), no Dr. Watson entry, no nothing.
It's an MFC app that does not really comprise anything very special. It does link in some external libraries – e.g., some old version of the Xerces C++ XML parser. But this is probably not too relevant, right?
The program has a class derived from CWinApp, and I tried to add some logging in its constructor. Based on this, it looks like not even this constructor is reached.
The server in question is running Windows Server 2003 Standard Edition Service Pack 2, and we are trying to run the program in a Remote Desktop session. (Because of the client's environment, I cannot easily test in a console session right now.)
I reverted my changes from version control, which did not help – but I do not know if I had built myself the previously installed version (which ran just fine even on this server) or if it had been built by someone else.
Have also tried to reinstall the Visual C++ runtime libraries and of course reboot Windows, but neither helped. Now I'm really running out of ideas... Any clues on what I could try or check?
Probably some error occurs but is surpressed e.g. empty catch() statement or similar.
You could try and install Debugging tools for Windows WinDbg to see if you could get more info when trying to run it. Since the download is rather small 25Mb maybe it is possible to install it on your client's PC.
But first check the eventview log for your app, maybe there is something in there that can shed some light.

VB6 + componentone developed application in Windows7

This is trouble shooting question.
Our application's development environment is VS2005 C/C++, VB6 based GUI.
we use also componentone for ActiveX control(vsflexgrid8).
application performed well in Windows XP, but in Windows 7, there is some problem in GUI.
rebuilded almost all C/C++ code and VB6 code in Windows 7
our build system is so poor and because I joined this team a month ago, building all codes are a bit hard
But this (maybe) last problem is not related to build, I think.
all other processes and GUI process are start well. but when click some menu in GUI, all user controls become invalid.
error message seems like this:
'-2147417848 (80010108)' occured
runtime error.
Automation error.
Invoked Object disconnected from
client.
above message is not identical to real message since real message is our native language(Korean).
when googling with this message, I'm able to gather some informations.
the most possible case is when using OLE Automation for Microsoft Office Objects.
But our GUI(VB6 developed) does not use Microsoft Office Objects.
And problem-causing page/control's are commonly use componentone modules.
So, if experienced similar problems, please help me.
In Virtual Machine Windows XP mode, there is no problem. But I'm strongly willing to develop in this environment.
Thank you for your help.
'Automation Error' just means that an error was raised from within the ActviveX control, but that the developpers did not add a description to it. So the cause could be anything.
A common source for this kind of errors are write errors to protected folder (The Program Files folder for instance) or forbidden Registry Read/Write actions. You could try installing the program to another location or to run it elevated.
Hope this helps at least a little.
As Dabbler says, this means there has been an error in the ActiveX component.
Does any of your C or C++ code run before this error happens?
Are you using the latest version of the ComponentOne control? Perhaps it's worth checking whether it is supported on Windows 7, and contacting their technical support?
You could debug the VB6 and C/C++ on Windows 7 to track down which bit of code triggers this problem. This is possible with Visual Studio 2005, which you say you have, or WinDbg which is free.
I solved this problem by Windows Updates.
Since about 20~30 updates are performed at once, I can't know what update solves this.
I guess Visual Studio 2005 security updates may the reason for this trouble.
Anyway, my application runs well in my Windows 7 machine.
Thanks to All.

VB6 crashes after build

Visual Basic 6 is crashing after a new build of my program. Whenever I Start (F5 or Ctrl-F5) my program after making changes to the code, VB6 crashes with the following message:
An unhandled win32 exception occured in VB6.EXE [XXXX].
I can't make any pattern out of XXXX. It's been 5168, 5012, 1488, etc; it changes every crash.
The JIT debugger then offers to let me debug VB6 in VS2010 (which shows nothing but a bunch of disassembly.) If I say no, VB6 shuts down. I can then open and Start my program immediately, and it runs just fine; my changes from before the crash were saved. Alternatively, I can make changes, save them, exit VB6, restart VB6, then run them without a problem. But it seems like as soon as I make any changes, a "crash" flag is set, and if I try and build it before restarting VB6, it simply dies.
I'm only having this problem with specific projects. Most projects work completely normally. It's just this one, and it's branch, that both act in the same manner.
Does anyone have any clue what's going on? Obviously, saving works. And building works. And running works. They just don't seem to work together.
I reinstalled VB6 to no avail.
I ended up on this page after installing VS2010, and just one of many VB6 project wouldn't compile.
Simply go to Project Properties / Compile tab, and uncheck "Create Symbolic Debug Info".
Hope it works for you.
Try to open vb6 project with compability mode as XP. We had some issues related to "make exe" command. Then I started to run VB6.exe with XP compability mode.
Since you're asking for any clues, possible clues may include:
The surprises VB6 experiences when run on Vista/7. Try running elevated/remove elevation.
Same, but applied to a third party ActiveX control you're using.
Not having the Service Pack 6 installed. Install it.
Subclassing issues. Make sure your subclassing, if any, is actually correct.
Whatever problems you'll never figure out. Try reinstalling.
Reinstall VB6, delete the workspace files and then create a new project adding in all your current code files. Then go out and get a job where they use a modern SDK :)

VB6 application no longer opens on Vista computer

I have a VB6 app that formerly worked perfectly on a Vista machine as a scheduled task, but it will no longer open on the same machine. The app generates export files in a specified folder with no direct output on the screen. I get no errors, no missing references, just absolutely nothing.
The machine is running Vista Business 32-bit, UAC is disabled with a single administrator account, and automatic updates are turned off. The app resides in a non-protected folder, and the export files are put in a folder on the desktop. The client swears that the only change they made to that computer since I installed this app was installing Norton Antivirus, which has never caused problems before with our software.
In addition to the normal VB6 references, the app references Microsoft Scripting Runtime (scrrun.dll), and Microsoft DAO 3.6 (dao360.dll). Both of these files are present and registered on the target machine, along with all the other VB6 dependencies. I added MsgBox statements at the beginning of Sub Main() just to see if anything is being executed, and its not. Disabling Norton yielded no results, nor did reinstalling VB6 runtime to rule out any corrupted libraries. Not once did I get any messages, error or otherwise from my app.
I've never had an issue like this before and I'm completely stumped. Is there anything else that could be causing this?
Edit - The app does not run even when I run it manually, so the part about it being a scheduled task is irrelevant to my problem, sorry for including it.
The user has full administrator credentials, no compatibility mode was needed on the initial test which at the time, was done on this very machine I am having the problem on. For grins I tried compatibility mode for XP and 2000, still nothing.
Try to inspect - if you can access them - the Event Viewer messages. Maybe you will find some tell-tell signs in there...
You could try running the program in Windbg, a free standalone debugger from Microsoft. Compile your VB6 EXE into native code with symbols (create PDB files) and you will be able to debug your application in Windbg.
I would guess one of two things will happen.
Windbg will fail to load the EXE. Presumably with an error message that will identify your problem.
Windbg will load the EXE, and you can single-step through to see what happens.
Here's a 2006 blog post by a Microsoft guy about using Windbg with VB6, and 2004 blog post by another Microsoft VB guy with a brief introduction to Windbg.
Has the user changed their password? That will cause the scheduled task to fail until they re-enter the password on the task.
Have you tried running the process directly, instead of as a scheduled task? I'm far from an expert, but it may be that any errors being generated are not showing up because the program is running as a task.

Resources