Jump to content
  • Advertisement


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


Arrrgh!!!! Pointers-Crash-Reboot!

This topic is 6112 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 been trying to solve this problem all night and I can''t seem to get around it. I''ve made a class called CTextField, which is baically a text field which would be used like a windows edit control. Everything in it works fine, except for one thing. What I have done is I have another class, called CGrfxFont, which is a font class I''ve made. Now, to display the text field on the screen, I draw the field itself and then the text over. To draw text, I use a CGrfxFont object and call the method "PrintText", which of course prints text to a coordinate on the screen. The thing is, that one of the member variables in a pointer to a CGrfxFont object so I can simply use "SomeFontObject->PrintText(params go here)" Anyway, the problem is that when I run the program, I get a bluescreen error and I am forced to restart my computer. This error ocurrs in the render method in my CTextfield class, which draws some rectangles to the screen and then uses the pointer to the font class to draw some text to the screen. I''m not sure what I''ve done wrong, could someone perhaps enlighten me on my mistake? I have remembered to set the pointer to the font object to 0 in the destructor since I''ve heard that VisualC++ debug often tries to release memory assigned to a pointer even if you didn''t release it yourself.

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.

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!