473,324 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Trapping C++ R6025 errors in the MS Visual Studio v7 debugger.

1
I am encountering an R6025 ("No object has been instantiated to handle the pure virtual function call") error in a complex application.
The error is intermittent and it is time consuming to reproduce.
I have read that setting a breakpoint in purevirt.c at the line "_amsg_exit(_RT_PUREVIRT);" will trap the error, but when I attach to my application, the debugger does not stop.

I tried to deliberately reproduce the same error in a much simpler application so that I knew how to trap it. (The code is reproduced below, borrowed from another post on R6025).
Setting the breakpoint as specified above succeeded in this (simple) case.

I have noticed that the dialog box shown in each case is different.
In the simple case, the runtime error identifies the debug library in the menu bar and offers 'abort'/'retry'/'ignore' radio buttons (hence the facility to stop the debugger through 'retry' and catch the error on the stack).
In the complex case, the runtime error identifies the runtime library in the menu bar and only offers an 'ok' radio button.

In both cases, the issue is *NOT* related to whether or not debug symbols are included in the build.

Questions:
1. What determines the format of the dialog box reporting the R6025? is it that in the simple case, the code is such that the error can be caught earlier, i.e. by the debugging environment and is therefore possible to debug, whereas in the complex case, a subtle coding difference causes the error to be caught later, e.g. by the operating system, and is therefore not possible to debug?

2. If it is indeed the nature of the code that causes the difference, then can anyone provide code that would result in the 'more limited' runtime version of the dialog box? How could this error be trapped?

3. If on the other hand the difference is due to some environment/ build setting, then what specific setting causes the difference?

Expand|Select|Wrap|Line Numbers
  1.  
  2. #include <iostream>
  3.  
  4. class A;
  5.  
  6. void f(A& a);
  7.  
  8. class A {
  9. public:
  10. A();
  11. virtual void pure() = 0;
  12. };
  13.  
  14. A::A()
  15. {
  16. f(*this);
  17. }
  18.  
  19. class B : public A {
  20. public:
  21. virtual void pure();
  22. };
  23.  
  24. void B:pure()
  25. {
  26. }
  27.  
  28. void f(A& a)
  29. {
  30. a.pure();
  31. }
  32.  
  33. int main()
  34. {
  35. try {
  36. B b;
  37. }
  38. catch (...) {
  39. std::cout << "Caught exception" << std::endl;
  40. }
  41. return 0;
  42. }
  43.  
Nov 20 '06 #1
0 1750

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Dario | last post by:
This is a technical C++ post regarding the Microsoft runtime error R6025 Pure Virtual Function Call that sometime occurs in programs compiled with Microsoft Visual C++ 6.0. Please consider the...
0
by: Scott Nonnenberg [MSFT] | last post by:
"The Visual Studio Debugger Do you have some burning questions or comments about SQL, C#, VB, C++, or script debugging support in Visual Studio? Want to know more about Visual Studio 2005's...
0
by: Scott Nonnenberg [MSFT] | last post by:
We'd love to see you there! The Visual Studio Debugger "Do you have some burning questions or comments about SQL, C#, VB, C++, or script debugging support in Visual Studio? Want to know more...
2
by: Scott Nonnenberg [MSFT] | last post by:
The Visual Studio Debugger "Do you have some burning questions or comments about SQL, C#, VB, C++, or script debugging support in Visual Studio? Want to know more about Visual Studio 2005's...
0
by: Scott Nonnenberg [MSFT] | last post by:
The Visual Studio Debugger "Do you have some burning questions or comments about SQL, C#, VB, C++, or script debugging support in Visual Studio? Want to know more about Visual Studio 2005's...
0
by: RameshK | last post by:
Hi All, Laucnhing a VC7.0 custom wizard using DTEClass of ENVDTE namespace. Subscribed to events like OnBeginShutDown,AfterClosing... During manual close of the wizard generated program, getting...
3
by: Antti Keskinen | last post by:
Hello ppl ! Since this newsgroup is a place where Microsoft MVPs or related visit somewhat often, could someone give me an advice with possible causes of this error. Note that it does not happen...
4
by: Mr. x | last post by:
How can I redirect any error that occurs in an html page to a debugger. (For some reason, this option is disabled on my computer - I want to enable it again). Thanks :)
0
jwwicks
by: jwwicks | last post by:
Introduction This tutorial describes how to use Visual Studio to create a new C++ program, compile/run a program, resume work on an existing program and debug a program. It is aimed at the...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.