If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Vc++ Debugging tips

hi all,

I am doing my project in vc++ and I am facing problems in Debugging.
It would be nice of u guys if u can suggest some Debugging tools or some tips regarding how to proceed toward debugging a Vc++ program.

I am facing this problem when i start debugging It stops and gives following message:

First-chance exception in IDS.exe: 0xC0000005: Access Violation
and when i click OK in message box it leads to me diassembly part.

Could u plss suggest me some tips regarding how to go on debugging vc++ programs.

Re: Vc++ Debugging tips

I am doing my project in vc++ and I am facing problems in Debugging.
It would be nice of u guys if u can suggest some Debugging tools or some tips regarding how to proceed toward debugging a Vc++ program.

I am facing this problem when i start debugging It stops and gives following message:

First-chance exception in IDS.exe: 0xC0000005: Access Violation
and when i click OK in message box it leads to me diassembly part.

Could u plss suggest me some tips regarding how to go on debugging vc++ programs.

And most important thing I am using VC++ 6.0

Thanx to all for ur time.

I use VC++ 6.0 all the time and have never received this message. However, upon googling I found this.

This is a brief preview of the symptom and cause (site also has a fix):

SYMPTOMS
When you debug a default Microsoft Foundation Class Library (MFC) AppWizard-generated program, the output window may display the following error message:
First-chance exception in &lt;SomeApp&gt;.exe (KERNEL32.DLL): 0xC0000005: Access Violation.
CAUSE
The Encompass Monitor or EncMonitor service is preinstalled on some systems. This service starts Monitor.exe and is loaded before the user logs on to the system. Monitor.exe performs the same function as the performance monitor Alert and Logging facility. With this utility, you can generate alerts and log data. This service causes the first-chance exception that is displayed in the output window.

You can safely ignore a lot of first-chance exceptions. Does your program execute? Why don't you post your code? You should be able to continue your program. Your debugger is probably just set up to get these types of violations.

It is always discouraging: First, one finally manages to compile, then there are runtime
errors, and finally the output is not as expected

To debug runtime errors, it is a crucial element to understand, where the error is thrown.
A message, such as yours, might by caused by boundary violations, writing to a file which
has been opened to be read and similar things.
E.g.

Code:

char buffer[16];
...
buffer[65536]=3;

VC++ has an excellent runtime debugger[1]. I suggest you to do the following:
- Set the active configuration to "Debug"
- place a breakpoint right in the beginning or somewhere close to where
you expect the error to happen and run the program.
- continue pressing F10 (or F11) until the error pops up
- replace the statement (if the error is not obvious) with something "trivial" in
order to isolate the malicious statement
- try again

Cheers.

/edit: Took me a while to write this Follow MathGirl's suggestion and post the code ...