Access violation with virtual methods, please help
I''ve got two classes at the moment: Object and ObjectManager
Now I need to derive classes from Object but I''m having problems with that.
Object has a virtual destructor and a virtal function Render (which does nothing at the moment). ObjectManager is a friend class of Object (and it''s derived classes). ObjectManager has a private member variable rootObject of the type Object*.
The problem is that I''m getting an access violation when I call rootObject->Render() from the ObjectManager class. And I''ve made sure that rootObject points to a valid Object.
Now here''s the strange part, when I remove the ''virtual'' keyword in front of the declaration of Render(), the problem goes away!
I''d really appreciate it if anyone has even the slightest tip for how I might solve this.
Thanks in advance.
Dirk "Scarab" Gerrits
''If knowledge is power, than to be unknown is to be unconquerable.''
- Unknown Romulan Centurion
Dirk =[Scarab]= Gerrits
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement