Click here to Skip to main content
15,898,978 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Setting an event on minimize Pin
Tom Wright13-Apr-05 4:49
Tom Wright13-Apr-05 4:49 
GeneralCTreeCtrl NM_CLICK notification. Pin
Maximilien13-Apr-05 4:08
Maximilien13-Apr-05 4:08 
GeneralRe: CTreeCtrl NM_CLICK notification. Pin
Michael Dunn13-Apr-05 7:31
sitebuilderMichael Dunn13-Apr-05 7:31 
GeneralPure Virtual Function Call Pin
abc87613-Apr-05 3:57
abc87613-Apr-05 3:57 
GeneralRe: Pure Virtual Function Call Pin
digwizfox13-Apr-05 6:49
digwizfox13-Apr-05 6:49 
GeneralRe: Pure Virtual Function Call Pin
Anonymous13-Apr-05 6:59
Anonymous13-Apr-05 6:59 
GeneralRe: Pure Virtual Function Call Pin
digwizfox13-Apr-05 10:45
digwizfox13-Apr-05 10:45 
GeneralRe: Pure Virtual Function Call Pin
Mike Dimmick13-Apr-05 8:37
Mike Dimmick13-Apr-05 8:37 
Most likely you are, indirectly, calling a pure virtual function in your base class constructor.

I recently wrote up how the compiler handles abstract classes and the C++ rules for which overrides are called at what point in answer to a question here[^].

Basically what's happening is you're trying to call through a virtual function that was declared pure either in your class or one of your base classes.

One possibility:
// In some header
 
class A
{
public:
   A();
 
protected:
   void OtherFunc();
 
   virtual void MyFunc() = 0;
};
 
class B : public A
{
public:
   B();
 
   virtual void MyFunc();
};
 
// Source file a1.cpp
 
A::A()
{
   OtherFunc();
}
 
void A::OtherFunc()
{
   MyFunc();
}
 
B::B()
{
}
 
void B::MyFunc()
{
}
When A's constructor body runs, the virtual function pointer is still pointing to A's vtable. The constructor calls OtherFunc which calls MyFunc, which is generated as a virtual call through the vtable. However, A::MyFunc is a pure virtual function; calling it this way is an error. The Visual C++ compiler traps the error by making the vtable slot point to a routine in the runtime library which reports the error.

Stability. What an interesting concept. -- Chris Maunder
GeneralRe: Pure Virtual Function Call Pin
Anonymous13-Apr-05 8:49
Anonymous13-Apr-05 8:49 
GeneralRe: Pure Virtual Function Call Pin
mark novak14-Apr-05 0:38
mark novak14-Apr-05 0:38 
GeneralService Control Manager types with MFC Pin
sweep12313-Apr-05 3:41
sweep12313-Apr-05 3:41 
GeneralRe: Service Control Manager types with MFC Pin
Alexander M.,13-Apr-05 3:55
Alexander M.,13-Apr-05 3:55 
GeneralRe: Service Control Manager types with MFC Pin
sweep12313-Apr-05 4:10
sweep12313-Apr-05 4:10 
GeneralRe: Service Control Manager types with MFC Pin
Ravi Bhavnani13-Apr-05 5:30
professionalRavi Bhavnani13-Apr-05 5:30 
GeneralRe: Service Control Manager types with MFC Pin
sweep12313-Apr-05 5:38
sweep12313-Apr-05 5:38 
Generalproblem with functions and variables... Pin
Green Fuze13-Apr-05 2:35
Green Fuze13-Apr-05 2:35 
GeneralRe: problem with functions and variables... Pin
David Crow13-Apr-05 2:41
David Crow13-Apr-05 2:41 
GeneralRe: problem with functions and variables... Pin
Green Fuze13-Apr-05 13:28
Green Fuze13-Apr-05 13:28 
GeneralRe: problem with functions and variables... Pin
Ryan Binns13-Apr-05 18:28
Ryan Binns13-Apr-05 18:28 
Generalencrypt to database in vc++ Pin
nehathoma13-Apr-05 1:52
nehathoma13-Apr-05 1:52 
GeneralRe: encrypt to database in vc++ Pin
Yulianto.13-Apr-05 15:02
Yulianto.13-Apr-05 15:02 
GeneralRe: encrypt to database in vc++ Pin
ThatsAlok14-Apr-05 19:36
ThatsAlok14-Apr-05 19:36 
GeneralA question on deleting entries in win registry Pin
PrashantJ13-Apr-05 1:24
PrashantJ13-Apr-05 1:24 
GeneralRe: A question on deleting entries in win registry Pin
ThatsAlok13-Apr-05 1:42
ThatsAlok13-Apr-05 1:42 
GeneralRe: A question on deleting entries in win registry Pin
PrashantJ13-Apr-05 2:20
PrashantJ13-Apr-05 2:20 

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.