Sign in to follow this  

VC++6 really irritating bug!

This topic is 4198 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I program in Visual C++ 6 and I have a big problem: Let's say that I have a small piece of code that creates a window and runs it. This piece of code works OK, with no problems. Then I decide to change it. I alter some parts of the code and then press "Execute." Of course, hardly anyone can write new code with no mistakes at all, so I obviously don't make my changes the correct way every time. Then I press "Execute" again. If the changes I've made to the code are correct, then nothing bad happens. But if I did it wrong, all heck breaks loose. The app will close after running unsuccessfully, as it should. But then the process for my program (ie. "mywindowsapp.exe") will persist in the Processes section under Task Manager, sometimes locking up the keyboard and sending CPU levels to 100%, until I kill the process. Even after that my problems are not over. I change my code back to the way it was before, but now it won't execute. VC++6 gives me a "cannot open debug/myprogram.exe" message. The code will compile with no errors, but I cannot make the program run! I can't even run the Clean command, because VC++6 tells me "access to debug/myprogram.exe is denied." What I eventually have to do is restart the computer. Once I've restarted, access to myprogram.exe is apparently no longer restricted and I am able to rebuild my program. This is a _huge_ pain. And it will happen over something fantastically minor, like adding a ShowWindow() command to WinMain or changing from WNDCLASS to WNDCLASSEX. Sometimes I'm not sure if the changes I make are even incorrect! Please, does anyone know what is going on here? What is happening exactly when VC++6 creates these undead you-have-to-go-to-Processes-to-finish-them programs? (I've been suffering with this particular phenomenon for a very long time now.) And why does this happen for such small, perhaps nonexistent, program errors? Is there some setting I need to change to allow me to write Windows code with more freedom? I really don't have the patience to go through this ordeal every time I try to execute an incorrectly written Windows program. Any help or info is very much appreciated!

Share this post


Link to post
Share on other sites
There are a few possibilities:

1) You are using VC++ 6. This is a bug in itself.
2) Your windows code is incorrect, and the window never properly closes itself. This is the most likely culprit (well, #1 is pretty bad too)
3) You just need to do a Rebuild All. Especially in VC6, the compiler doesn't always update dependencies perfectly, leading to some bizarre clashes during linking.
4) You are using VC++ 6. I think it's time to upgrade :)

Share this post


Link to post
Share on other sites
I would guess ... and this is only a guess ... that your message loop is running out of control because you're not calling PostQuitMessage(0) on your WM_DESTROY message handler.

:-D

Share this post


Link to post
Share on other sites
I think most people will refuse to help you until you upgrade to something better. Visual Studio 6 is very old and buggy. A new and better compiler by Microsft, called Visual Studio 2005, can be found for free here. There is plenty of info on upgrading your apps and on how to change your IDE. You should really do it now, as Visual Studio is very very bad.

Share this post


Link to post
Share on other sites
Quote:
Original post by krum
I would guess ... and this is only a guess ... that your message loop is running out of control because you're not calling PostQuitMessage(0) on your WM_DESTROY message handler.

:-D


Ah, it's been years since I wrote windows code, but thats exactly the problem I was thinking of (just couldn't remember the details).

To OP: krum is probably right.

Share this post


Link to post
Share on other sites
This problem has little to do with VC6. Your application just isn't properly terminated, so only the window is destroyed but the application is still running (as krum said). Because the executable is still in use, the compiler cannot overwrite it. It gets even worse in debug mode, because the system will not allow the executable to be destroyed from the outside. Usually it should suffice to just kill Visual Studio which will take the debug process down with it. Hope this helps.

Share this post


Link to post
Share on other sites
krum might be right if this happens every time. However, I had the same issue when I used VC++6, every so often (once in 50 compiles or so) cl.exe failed to exit. This is why it can't output the exe file, if you task manager cl.exe you will be able to compile and have it produce the new executable.

I never noticed any specific symptoms that led to this happening like you have listed, but its possible. I only remember it happening on compiles with errors, but never associated the two because it didn't always happen.

The solution is to upgrade from VC++ 6, it is basically one gigantic bug.

Share this post


Link to post
Share on other sites
Quote:
You are using VC++ 6. I think it's time to upgrade :)

the new version whilst much better than vc6 in most reguards its way slower + clunker, thus in windows if i wanna quicky code up a demo i use vc6, even though i have vc express 2005 installed

Share this post


Link to post
Share on other sites
Quote:
Original post by zedzeek
Quote:
You are using VC++ 6. I think it's time to upgrade :)

the new version whilst much better than vc6 in most reguards its way slower + clunker...

It's not slower. It's not "clunkier," either; it simply requires a complete project to build anything. If you want to quickly code up a demo, start a new project, select Win32 Console Application and select Empty Project under the options. Same as VC++ 6.

Please, stop using VC++ 6. You're making 5-year old Oluseyi cry.

Share this post


Link to post
Share on other sites
Quote:
Original post by Oluseyi
Quote:
Original post by zedzeek
Quote:
You are using VC++ 6. I think it's time to upgrade :)

the new version whilst much better than vc6 in most reguards its way slower + clunker...

It's not slower. It's not "clunkier," either; it simply requires a complete project to build anything. If you want to quickly code up a demo, start a new project, select Win32 Console Application and select Empty Project under the options. Same as VC++ 6.

Please, stop using VC++ 6. You're making 5-year old Oluseyi cry.


Was "5-year old Oluseyi" even born when VC++ was new? :)

Personally, I hate IDEs and their whole "project" concept. Every one I've used has found some way or other of messing things up that I know how to do perfectly well from the command line (except IDLE, which still messes things up; but it's the interpreter that is messing things up, in the sense that there's no real "global reset" switch for the Python interpreter. And even then, I usually do most of my editing in gVim and only start up IDLE to test.). And I grew up on MacOS!

Share this post


Link to post
Share on other sites
Quote:
Original post by Zahlman
Was "5-year old Oluseyi" even born when VC++ was new? :)

Nah. I was 15 when I got the MSVC 1.52/4.0 academic bundle. "5-year old Oluseyi" is a reference to the vestiges of innocence and purity left in me. [smile]

Quote:
Personally, I hate IDEs and their whole "project" concept.

I just dislike the fact that many of them have made it mandatory. You used to be able to start up MSVC, create a new text file, type up some code and then hit compile. It'd ask you for a file name, save the source, compile and generate a binary if possible.

It's a reflection of a larger fascination with "frameworks." "We do all the work for you, you just plug in bits of functionality here and there." Except that it all falls apart when you want to do something they didn't envision.

Share this post


Link to post
Share on other sites
I don't understand why everyone says VC6 is so buggy. i've been using it for years, and nothing ever goes wrong that wasn't my mistake.

Share this post


Link to post
Share on other sites
VC6 is not as buggy as people are saying. It's major problem is non-compliance with the C++ spec, particularly in the area of templates and the infamous for-scope issue. The latter issue is a result of the compiler being written *before* the C++ spec was finalized and C++ comittee waffling.

Nevertheless, VC6 is over 10 years old. There's really no excuse to keep using it other than perhaps having an extremely lame customer who insists that whatever libraries you might be giving them use the VC6 runtime.

I don't know what the OP's problem is. I never saw such behavior when I was using VC6. Chances are very high it has something to do with your code. You're not using Win9x are you? If so that could be your problem as well.

Share this post


Link to post
Share on other sites
Quote:
Original post by ZahlmanAnd I grew up on MacOS!
[cool]As did I![cool]
Those were the days...

You could reinstall VC++6 and service packs etc, as that might help.
Then there's the newer and highly recommended FREE VS2005 Express, in case you still haven't been persuaded yet.

Share this post


Link to post
Share on other sites
Quote:
Original post by Oluseyi
Quote:
Original post by Zahlman
Was "5-year old Oluseyi" even born when VC++ was new? :)

Nah. I was 15 when I got the MSVC 1.52/4.0 academic bundle. "5-year old Oluseyi" is a reference to the vestiges of innocence and purity left in me. [smile]


Yeah, I know. I'm just pointing out that it's more than 5 years old. :)

Quote:
Except that it all falls apart when you want to do something they didn't envision.


I've found it to fall apart on its own. And also hog system resources (y helo thar compile-as-you-go; would you mind not being quite so aggressive? My RAM is limited and I'd kinda like to finish typing this statement so you can stop complaining about it...)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
VC6 is fine for C projects. If you're doing anything with C++ you should switch as soon as possible, though.

Share this post


Link to post
Share on other sites
Well, thanks a lot for all that feedback! I always knew that VC++6 get a bad rap, but I never knew that there was _that_ much sentiment against it. At least I know I'm not alone!

I have been thinking about switching to VC++2005, but until now I've not been sure if it would be worth the trouble to install it. I guess it will be...

But I need to ask some questions about installing VC++2005. I'm asking these because my life with VC++6 has made me almost superstitious about deving programs and I want to do this absolutely right in case VC++2005 goes buggy on me and I'm never able to fix it.

First of all: how do I uninstall VC++6 _completely_ so that not a trace of it is left to interfere with VC++2005? Will the Uninstall command under the Control Panel suffice, or do I have to hunt down tons of temp files also? Do I need to destroy all my old project files? Something tells me that VC++6 is going to die hard, and I know that I have to completely get rid of it before I can risk running another compiler.

Secondly: I want to download the version of VC++2005 which is offered free on msdn (I believe it's called "Express Edition" or something like that.) I just want to know if there are any restrictions on this compiler. My ultimate goal is to finish my game and make as much money as I can off of it, so I really need to get a compiler with no royalties or limiting license agreements.

Thanks!

Share this post


Link to post
Share on other sites
You shouldnt have any problems installing VS 2k5 EE alongside VC++ 6.0. On my work machine I have VC++ 5.0, VC++ 6.0 and VS 2k5 installed and they all work fine.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by synth_cat
Secondly: I want to download the version of VC++2005 which is offered free on msdn (I believe it's called "Express Edition" or something like that.) I just want to know if there are any restrictions on this compiler. My ultimate goal is to finish my game and make as much money as I can off of it, so I really need to get a compiler with no royalties or limiting license agreements.


You can use it for whatever you want, even commercial applications.

Share this post


Link to post
Share on other sites
Sweet! I will definitely install it. But first I'm going to clear out everything. Even if Visual C++ 6 won't do anything to me just sitting there, I like to have my hard drive neat. It would be great if the Uninstall command would just get rid of all the directories and files so I don't have to track them all down...

Share this post


Link to post
Share on other sites
You might want to actually hold on to VC++ 6 if you do not have another Win32 resource editor as the Express version of VC++ 2005 does not have one.

Share this post


Link to post
Share on other sites
Mastaba,

I'm sorry, but I'm not quite sure what you mean by "resource editor." Is this something absolutely essential for making a game, or is it just something used for creating icons and such?

Share this post


Link to post
Share on other sites

This topic is 4198 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this