"m_pDevice = pDevice" ... Causing access violation??

Started by
2 comments, last by SimDemon 20 years, 11 months ago
I have made a few posts already today, and I have another problem. I got the CD3DFont class working, but it won''t draw text. I made a function in my game''s font class like this:
  
void RR_Font::SetDevice(LPDIRECT3DDEVICE8 pDevice) 
{
    if (pDevice != NULL)      // Valid device

        m_pDevice = pDevice;      // Copy LPDIRECT3DDEVICE8 object

}
  
But when I run in debug mode, it says there''s an access violation on the line "m_pDevice = pDevice". The ''pDevice'' object is valid. What''s wrong here?
I'll have a link to the TriFaze website as soon as possible. It's still currently being designed, by myself of course! =) I'll update the URL and my signature as soon as possible.Feel free to send me a message on Yahoo! or AOL IM™. =)
Advertisement
Generally this would happen if the "this" pointer is invalid; in other words, the object has not been properly contructed before your method is called.
Well, I got it working now! Not sure what the problem was. =)
I'll have a link to the TriFaze website as soon as possible. It's still currently being designed, by myself of course! =) I'll update the URL and my signature as soon as possible.Feel free to send me a message on Yahoo! or AOL IM™. =)
Ok, so it DOESN''T work. It worked once, I changed the instance of the RR_Font class from pFont to pMainFont, and it quit working.
I'll have a link to the TriFaze website as soon as possible. It's still currently being designed, by myself of course! =) I'll update the URL and my signature as soon as possible.Feel free to send me a message on Yahoo! or AOL IM™. =)

This topic is closed to new replies.

Advertisement