VC Debugging Problem in XP

Just recently I switched from Windows 2000 to XP. But in using VC 6.0, I got a different debugging response of XP from that of Windows 2000. In Windows 2000, when I run the debug version of a program in "non-debug" mode and encounter an ASSERT line, a dialog will pop up to allow me to stop at the ASSERT line, showing where the ASSERT is. But, in XP, a similar dialog, but different, will also pop up, but clicking "Debug" button will terminate the program execution, and return to project editing status. I have no way to know where the ASSERT is. I have to re-run the program in "debug" mode to enable the debugging and try to re-produce the problem.

In XP, I still can use the debug mode to trace the execution, but in "non-debug" mode, XP will not give me the ASSERT information when it occurs.

Do I miss somthing in installing VC 6.0 in XP?
beenderAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AlexFMCommented:
1) In any case ASSERT message contains information about assertion: source file and line number
2) If you run the program from Windows Explorer and not from Visual Studio, and it shows Assertion dialog, click Rerty, click Debug in the next dialog, and debugger is opened successfully in the new Visual Studio instance.
3) If you run the program from Visual Studio, you have a problem: instead of showing Debug window, it shows Exception Breakpoint window and closes the program. Solution: when Assertion dialog is shown, close Visual Studio instance from which the program was executed. Now click Retry, Close, and it works like in p.2.

Not so nice, but it works. Maybe somebody knows a better solution.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AlexFMCommented:
Correction in p.3:
Now click Retry, Debug, and it works like in p.2.
0
SteHCommented:
What do you mean with non debug version? Since MSDN states:
[quote]
In the Release version of MFC, ASSERT does not evaluate the expression and thus will not interrupt the program. If the expression must be evaluated regardless of environment, use the VERIFY macro in place of ASSERT.

Note   This function is available only in the Debug version of MFC.
[/quote]
So I am a bit puzzled where the ASSERT comes from in a non debug (= Release?) build. But if a message box appears at least you should see the file and the line number to have a look at your code.

Another guess. In Release the program opens a new instance of Studio to debug the application. Have you selected the correct one?
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

jkrCommented:
See http://www.microsoft.com/technet/treeview/default.asp?url=/technet/prodtechnol/winxppro/proddocs/drwatson_setup.asp on how to set up the debugging option. Just make sure to use

"<path to msdev>\msdev.exe" -p %ld -e %ld

as the "Debugger" value instead of 'drwtsn.exe'.
0
AlexFMCommented:
>> when I run the debug version of a program in "non-debug" mode...
This means: run the Debug version using Run and not Go command.

Setting of msdev as current debugger is done automatically during Visual Studion installation.
0
beenderAuthor Commented:
AlexFM's p1, p2, p3 provides the concise answers to XP debugging problem. That leads me to dig more into IDE's debugging capability.

I found that bringing up the debugger when executing program (Ctrl+F5), not GO (F5) inside IDE is so-called Just-in-time debugging. Shame on me that I have been using VS 5.0/6.0 for many years in Win98, NT4, then Windows2000, and did not know this terminology. In Windows 2000, if you turn off Just-in-time debugging (Tools/Options/Debug tab), you will not be able to bring up the debugger when executing a program and encounter an assertion. I think it is a very neat feature for program developing, and I heavily rely on this feature.

Come to XP version. It seems to me that Microsoft enhances just-in-time debugging, but also introduce a bug (at least I do not know how to enable this JIT debugging while in IDE). But I observeed this JIT debug in IDE closely, and found that the debugger DOES come up showing call stack, disassembly, variables,... windows. Then for some reasons, it quits. Hopefully, it just requires some data and path settings, etc, and some one knows those settings.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.