Hi,

Im using DX9c and learning from Frank Luna's book to try and handle OnLostDevice and OnResetDevice, when switching to fullscreen and back (and alt+tabbing).
If I dont draw anything I am able to go from windowed to fullscreen, and back, with no trouble. But adding a draw and flush then pressing the fullscreen key causes the following msgbox error: (at the m_pSprite->flush();)

Unhandled exception at 0x56E5B1FC (D3DX9_43.dll) in DXTB 14.exe: 0xC0000005: Access violation writing location 0xCCD020CC.

Although I do enjoy getting stuck on problems I have been rearranging my code and typing like a monkey for 1 week now (on this issue). Please can you correct where I am going wrong?

Resolution is sweeter the longer you wait. (please dont qoute it back at me though! hehe)

***************SOLVED***********************
anytime there is an access violation, in this context, it means that I was trying to access resources that device->reset had, well, reset! The simple solution was to find and track down which object I had not called OnLostDevice and OnResetDevice for. This includes all ID3DXSprite and D3DXFont and D3DXLine interfaces/objects.

God bless you in Jesus name

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.