Click here to Skip to main content
15,887,485 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: GDI+ graphics->DrawLine erratic behavior?? Pin
KellyR16-Jul-06 4:11
KellyR16-Jul-06 4:11 
AnswerRe: GDI+ graphics->DrawLine erratic behavior?? Pin
Hamid_RT16-Jul-06 1:51
Hamid_RT16-Jul-06 1:51 
GeneralRe: GDI+ graphics->DrawLine erratic behavior?? Pin
KellyR16-Jul-06 4:13
KellyR16-Jul-06 4:13 
GeneralRe: GDI+ graphics->DrawLine erratic behavior?? Pin
Hamid_RT16-Jul-06 9:34
Hamid_RT16-Jul-06 9:34 
AnswerRe: GDI+ graphics->DrawLine erratic behavior?? [modified] Pin
bob1697216-Jul-06 10:30
bob1697216-Jul-06 10:30 
GeneralRe: GDI+ graphics->DrawLine erratic behavior?? Pin
KellyR16-Jul-06 12:55
KellyR16-Jul-06 12:55 
QuestionCatching "R6025 - pure virtual function call error" using SEH Pin
Chintoo72315-Jul-06 18:06
Chintoo72315-Jul-06 18:06 
AnswerRe: Catching "R6025 - pure virtual function call error" using SEH Pin
Mike Dimmick16-Jul-06 7:08
Mike Dimmick16-Jul-06 7:08 
An R6025 pure virtual function call error occurs because you've called a pure virtual function - one where you declared
virtual void MyFunc() = 0;
The compiler writes the address of a handler function to the slot in the virtual function table corresponding to the function for this class - this handler generates the run-time error.

An object whose class has virtual functions carries a virtual function pointer [vfptr] which points to the correct virtual function table [vtable] for the class. During execution of each class's constructor in the hierarchy, from top to bottom (base to derived), the vfptr points to that class, so for example, if you have CBase, CMiddle and CDerived, where CMiddle derives from CBase and CDerived from CMiddle, and you create an instance of CDerived, during CBase's constructor(s) the vfptr points to CBase's vtable, during CMiddle's constructor(s) the vfptr points to CMiddle's vtable, then during CDerived's constructor(s) the vfptr points to CDerived's vtable. Therefore, while the class constructor is executing, if the class has pure virtual functions, the pure virtual function could be called.

If you call a pure virtual function within some other function, and call that function from within a constructor, you'll get an R6025 runtime error.

Example:
class CBase
{
public:
   virtual void A() = 0;
 
   CBase()
   {
      B();
   }

   void B()
   {
      // Causes R6025
      A();
   }
};
 
class CDerived : public CBase
{
public:
   void A()
   {
   }
};
 
int main(int argc, char* argv[])
{
   CDerived derived;
 
   return 0;
}


Stability. What an interesting concept. -- Chris Maunder
Question\t char gives 3 spaces instead of 4 Pin
sphereboy15-Jul-06 15:06
sphereboy15-Jul-06 15:06 
AnswerRe: \t char gives 3 spaces instead of 4 Pin
led mike15-Jul-06 16:02
led mike15-Jul-06 16:02 
GeneralRe: \t char gives 3 spaces instead of 4 [modified] Pin
sphereboy15-Jul-06 16:14
sphereboy15-Jul-06 16:14 
GeneralRe: \t char gives 3 spaces instead of 4 Pin
led mike15-Jul-06 16:34
led mike15-Jul-06 16:34 
GeneralRe: \t char gives 3 spaces instead of 4 Pin
sphereboy15-Jul-06 19:36
sphereboy15-Jul-06 19:36 
GeneralRe: \t char gives 3 spaces instead of 4 Pin
led mike16-Jul-06 20:11
led mike16-Jul-06 20:11 
QuestionHow-to convert a Makefile into VC2005 express project? Pin
vgnogueira15-Jul-06 13:35
vgnogueira15-Jul-06 13:35 
AnswerRe: How-to convert a Makefile into VC2005 express project? Pin
Mike Dimmick16-Jul-06 7:14
Mike Dimmick16-Jul-06 7:14 
QuestionRe: How-to convert a Makefile into VC2005 express project? Pin
stretchcoder4-Oct-06 8:15
stretchcoder4-Oct-06 8:15 
AnswerRe: How-to convert a Makefile into VC2005 express project? Pin
Mike Dimmick5-Oct-06 1:01
Mike Dimmick5-Oct-06 1:01 
GeneralRe: How-to convert a Makefile into VC2005 express project? Pin
stretchcoder5-Oct-06 3:31
stretchcoder5-Oct-06 3:31 
QuestionTaskbar Starting Message Pin
Gregory Braun15-Jul-06 13:13
Gregory Braun15-Jul-06 13:13 
AnswerRe: Taskbar Starting Message Pin
Garth J Lancaster15-Jul-06 13:34
professionalGarth J Lancaster15-Jul-06 13:34 
AnswerRe: Taskbar Starting Message Pin
Ravi Bhavnani16-Jul-06 5:33
professionalRavi Bhavnani16-Jul-06 5:33 
GeneralRe: Taskbar Starting Message Pin
Gregory Braun16-Jul-06 17:00
Gregory Braun16-Jul-06 17:00 
QuestionDraw a text overlay in a running DirectX game (Battlefield 2) [modified] Pin
StefanKittel15-Jul-06 12:50
StefanKittel15-Jul-06 12:50 
AnswerRe: Draw a text overlay in a running DirectX game (Battlefield 2) Pin
led mike15-Jul-06 16:05
led mike15-Jul-06 16:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.