Results 1 to 6 of 6

Thread: Vc++ Debugging tips

  1. #1
    Junior Member
    Join Date
    Feb 2005
    Posts
    24

    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.

    And most important thing I am using VC++ 6.0

    Thanx to all for ur time.

  2. #2
    () \/V |\| 3 |) |3\/ |\|3G47|\/3
    Join Date
    Sep 2002
    Posts
    744

    Re: Vc++ Debugging tips

    Originally posted here by davinci
    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.

    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 <SomeApp>.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.

    Go Finland!
    Deviant Gallery

  3. #3
    Junior Member
    Join Date
    Feb 2005
    Posts
    24
    But I am not using MFC at all.

  4. #4
    () \/V |\| 3 |) |3\/ |\|3G47|\/3
    Join Date
    Sep 2002
    Posts
    744
    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.

    Go Finland!
    Deviant Gallery

  5. #5
    Senior Member
    Join Date
    Mar 2004
    Posts
    557
    Hi

    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 ...

    [1] http://www.msoe.edu/eecs/cese/resour...cmfc/dbgvc.htm
    If the only tool you have is a hammer, you tend to see every problem as a nail.
    (Abraham Maslow, Psychologist, 1908-70)

  6. #6
    Junior Member
    Join Date
    Feb 2005
    Posts
    24
    sec_ware,
    That was quite helpfull and helped a lot .

    My programm is running but it gives some exceptions sometimes .
    It has now become pretty long so it would be difficult to post here.

    Remove 1 bug and u get 100 more. Programmers life is just like that

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •