Jump to content
  • Advertisement
Sign in to follow this  
Farraj

Problem with a class

This topic is 3596 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

Hi everyone. I’m having trouble with something. In my SubSystemManager.h file I have a class and a function that uses that class as an argument: class SubSystemManager { … … … void someFunction(void); }; unsigned int GetEntity(SubSystemManager *ssMgr); Now in my SubSystemManager.cpp I call the GetEntity function from inside one of the class functions like so: void SubSystemManager::someFunction(void) { GetEntity(this); } unsigned int GetEntity(SubSystemManager *ssMgr) { // some code Return 0; } OK, now, the above compiles without any errors, but when I run the program it crashes when the class function calls the GetEntity function. It doesn’t matter if the GetEntity function is empty (only return 0, I tried it) the program crashes. GetEntity works fine when I call it anywhere outside the SubSystemManager.cpp file. Any idea why this happens? Cheers

Share this post


Link to post
Share on other sites
Advertisement
What do you mean it "crashes"? What's the exact error you get? Also, what compiler are you using, and have you tried doing a rebuild all?

Share this post


Link to post
Share on other sites
Oh, sorry. I forgot to add this.

I’m using VC++2005 on a windows xp. When I say crash, I mean when the program reaches that line it freezes and I get a windows message telling me that there was a problem (it doesn’t say).

And yes, I did use Rebuild All. And it crashes on both Debug and Release builds.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!