Hi all,

I have a piece of program written in Visual C++ which works just fine in Win XP. However when its run in Vista, the error message "A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available." is shown only when I exit the program (the program is exited in a correct manner). Only the "Close program" button is available for clicking.

Actually, everything just works fine but the message pops up when program is exited. All data read and write are correct. Applications behave and respond correctly before the exit.

I suspect that its some kind of incompatibility to Vista in my codes. Please advise. Thank you!

Edward's first guess without seeing the code is that you corrupt your memory somewhere and Vista is better at catching it with a hard failure, or you're just getting lucky on XP. But without seeing the code, all Ed can do is guess.

Thank you for the info, Edward. Here's more information.

The application calls a function in a DLL (which was written by me). When the debug's DLL is used, the application does not crash when exit (running on Vista). However, it crashes upon exit when the release's DLL is used instead (also running on Vista). The application works fine with both the debug's and release's DLL running on XP.

Thank you for the info, Edward. Here's more information.

The application calls a function in a DLL (which was written by me). When the debug's DLL is used, the application does not crash when exit (running on Vista). However, it crashes upon exit when the release's DLL is used instead (also running on Vista). The application works fine with both the debug's and release's DLL running on XP.

Unless you post the code and perhaps a screenshot of the error message, it is pretty much impossible to help here any further.

Hi mitrmkar,

I've attached the error message in this post. I've done a search through the Internet and found this this is quite a common case. However, there isn't much clue as to how to fix it code-wise. Any help is very much appreciated.

Attachments error_msg.JPG 13.88 KB

I've done a search through the Internet and found this this is quite a common case. However, there isn't much clue as to how to fix it code-wise. Any help is very much appreciated.

Now, if you think of it, nobody here has a clue as to what your code does ... how could anyone help you?

> When the debug's DLL is used, the application does not crash when exit (running on Vista).
> However, it crashes upon exit when the release's DLL is used instead (also running on Vista).
That means there are bugs in your code for sure.
Unless you post some code, then you're on your own. Try running the release code in the debugger. It should at least give you some idea of where the problem is.

> The application works fine with both the debug's and release's DLL running on XP.
That just makes you lucky, not good.

Your debugging effort stopped when the program stopped crashing, but that didn't mean the program was bug-free.


If you want more phrases, then try these.
"Testing can only be used to show the presense of functionality, not the absense of bugs."
"Testing is like pouring cold water into a chocolate teapot and saying that it works."

thank you for all your feedback. Finally, I'm able to resolve the problem. Its a memory corruption problem. All I can say is, be careful when choosing between "wmemset" and "memset".

Nothing wrong with those functions, only your inability to use them.
If you can't manage memory, then a whole raft of functions become "a problem" for the programmer.

This question has already been answered. Start a new discussion instead.