Archived

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

how do i restore my DDraw surface if i get this error: DDERR_WRONGMODE

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

DDERR_WRONGMODE: This surface cannot be restored because it was created in a different mode. well, i don''t know why it gives out that error, i created my surface using dxsdk version 8.1, declared my variable LPDIRECTDRAW7 and LPDIRECTDRAWSURFACE7. What i did is, pressed ''alt-tab'' then return to my app and did the error checking this way: ---------------------------------------------- HRESULT hr = Backbuffer-Blt(...) if(hr == DDERR_SURFACELOST) // i tried doing all of this! // hr = DirectDrawObject->RestoreAllSurface(); // hr = DirectDrawSurface->Restore(); ---------------------------------------------- then after the last two operations, my HR will contain that error message, thanks! hope you guys could help me out here

Share this post


Link to post
Share on other sites
If it''s an Alt-Tab that is giving you difficulties it might be that your surface is not set up to share with other applications. Check the DX documentation for the surface descriptor structure that is used as a parameter to the CreateSurface function. One of the settings of this structure will allow your application to share the screen with other Windows applications.

Even if this is not the specific answer to your problem the Surface Descriptor is the most likely source of answers to problems connected with creating a surface.

Garvin.

Share this post


Link to post
Share on other sites
hi tifkagh! thanks very much for your help. I have solved my problem haha, well it''s because I didn''t realize that when i do press alt-tab, my program is still running at background that''s why it gives out that DDERR_WRONGMODE which is true, but when i switch back to again to my program, it successfully restores the surface i just forgot to put everything back on the surfaces,

Share this post


Link to post
Share on other sites