Advertisement

Visual C++ help

Started by October 26, 2000 08:43 AM
9 comments, last by saisoft 24 years, 2 months ago
My programs were executing fine before, but I do not know what I did. My program''s now compile and build with no errors, but when I try to execute the program, it does nothing and even if I try to execute from outside the compiler environment, the executable does nothing. Please, someone help, thanks
If that''s all the information you have, none of us will be able to help you.

All I can tell is that you changed something that''s causing your program to terminate on startup without an error report.


People might not remember what you said, or what you did, but they will always remember how you made them feel.
~ (V)^|) |<é!t|-| ~
It's only funny 'till someone gets hurt.And then it's just hilarious.Unless it's you.
Advertisement
More info is always nice (although I suspect I have been guilty of not supplying enough info). If you are using MFC and Rich Edit boxes, I may know the answer. I had a dialog once that would work just fine, then I decided to convert to rich edit controls to do text formatting... The program wouldn''t run. Or at least it did look like it was running. The problem was I needed to add a line called AfxInitRichEdit() (I think thats it, check MSDN) to the InitInstance() member of my app class. Or was it the InitDialog() member of the dialog class? I don''t know... look up that function in MSDN, if any of this has any bearing on your problem.

--------------------


You are not a real programmer until you end all your sentences with semicolons; (c) 2000 ROAD Programming


You are unique. Just like everybody else.

Yanroy@usa.com

Visit the ROAD Programming Website for more programming help.

--------------------

You are not a real programmer until you end all your sentences with semicolons; (c) 2000 ROAD Programming
You are unique. Just like everybody else.
"Mechanical engineers design weapons; civil engineers design targets."
"Sensitivity is adjustable, so you can set it to detect elephants and other small creatures." -- Product Description for a vibration sensor

Yanroy@usa.com

Thats, the problem, I can''t remember exactly what happened. The only thing that comes to mind, is that I went to BUILD/CONFIGURATIONS and deleted debug, but I don''t think that caused it. I just want to know if someone has experienced this before , they can tell me how it is caused. I am using no MFC, just win32.
Wow, bud =)

We''re going to need a LOT more information than that.

It''s almost certainly a run-time error (since it''s compiling and building fine), but if you suspect the compiler is mistreating you, set your warning level to maximum. This may get annoying, but it will catch things like unused/uninitialized variables and other things that wouldn''t hurt the compile but may hinder runtime.

What you also might do (as another general debugging tactic) is to trace thru your program. Note that you can''t trace when you have a surface locked, so if you''re using DirectDraw you won''t be able to do this. In fact, your computer will hate you for trying =). If you''re not locking surfaces (though I can''t imagine why not!) then you can likely trace; if you''re using an exclusive screenmode, pick up a second monitor/video card (just a cheapy pair) and set that as your primary monitor...then visual C will show up there and you can watch your game on your good card/monitor as you trace thru. (This will not work, again, if you have surfaces locked.) For more information on this, refer to your DirectX "Multimon" docs. (It''s not hard; I''m new and I have it running on my system. =)

The most basic and probably best idea is to just look at the very last thing you changed in your program. If it was working fine until the change, then clearly that change is probably the culprit.

One last note: if you can''t trace because of surface-locking and you''re out of options, what I have resorted to in the past is having the program have only two ways to exit: either because I hit a key, or because it fails in *one* way. Kind of a

if (thislineofcodedoesn''treturnasuccess)
then dump me out to the os

type of thing. Clearly there are lots of things you can try. Don''t give up!!! If you come across the exact location of the problem, bring it up and we''ll see what we can do. =)

Happy coding, friend.

~Steve

"We are men of action. Lies do not become us."
Looks like a bunch of you figured it out before I finished my little general info session on debugging. =)

Cheers =)
Advertisement
your main window may not be visible.
cmaker- I do not make clones.
I did not make any changes to code, it is just a window that pops on the screen.
I don''t know if this would help, but my project name is window1 and I pressed ctrl-alt-del and saw an instance of my program for everytime i pressed execute
Please help!!!!

This topic is closed to new replies.

Advertisement