Advertisement Jump to content

Archived

This topic is now archived and is closed to further replies.

Scarab0

Access violation with virtual methods, please help

This topic is 6395 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
Doh, nevermind. I fixed it already. It was due to some obscure bug in another file.
But thanks anyway. ;P

Dirk "Scarab" Gerrits

''If knowledge is power, than to be unknown is to be unconquerable.''
- Unknown Romulan Centurion

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!