how do i restore my DDraw surface if i get this error: DDERR_WRONGMODE
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
http://www.dualforcesolutions.comProfessional website designs and development, customized business systems, etc.,
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.
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.
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,
http://www.dualforcesolutions.comProfessional website designs and development, customized business systems, etc.,
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement