From Google, maybe it can be this problem : Can't DirectX Create Surface unless we "disable full screen optimizations"
(and you should use C++ tag)
DirectX question/problem DDERR_UNSUPPORTEDMODE
I am trying to update 20 year old software that was last build on windows xp with visual studio 2003.
The existing program has the following code:
DDSURFACEDESC ddsd;
memset(&ddsd, 0, sizeof(ddsd));
ddsd.dwSize = sizeof (ddsd);
ddsd.dwFlags = DDSD_CAPS;
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
LPDIRECTDRAWSURFACE directDrawSurface = mLpBuffer[DISPLAY_BUFFER];
HRESULT ddRetVal = mLpDDObject->CreateSurface(&ddsd, &directDrawSurface, NULL);
(I added the memset, not that it made a difference).
I have three Windows 10 computers. On my development machine, that code runs fine and ddRetVal is S_OK.
On the other two computers, ddRetVal gets set to 0x8876024e (DDERR_UNSUPPORTEDMODE) - The display is currently in an unsupported mode.
- Is there any way to determine what exactly is unsupported?
- Is this likely to be a function of the graphics processor?, the driver?, both? Neither? Something else?
- Is the problem some display settings in Windows?
Windows development Windows API - Win32
Windows for business Windows Client for IT Pros User experience Other
Developer technologies C++
3 answers
Sort by: Most helpful
-
Castorix31 90,521 Reputation points
2022-09-20T13:42:25.727+00:00 -
james bloomscheff 1 Reputation point
2022-09-20T14:10:22.277+00:00 I have some additional details and probably the cause of the problem, although not the solution.
One of the two laptops that doesn't work doesn't support the screen resolution that is being set.
The other computer that doesn't work does support the resolution, but works differently depending on whether I am remote desktopped to the computer or not. When remote desktopped, the command fails. When I don't remote desktop, the program fails elsewhere. The control panel is also unable to set the screen resolution when remote desktopped.
-
james bloomscheff 1 Reputation point
2022-09-20T14:21:32.33+00:00 One would think that that would be the solution, as the symptoms are identical, but checking "disable full screen optimizations" on the executable did not eliminate the problem.
The call to CreateSurface still fails for the same reason. If I ignore the error, then a later call to lock the surface fails
I'm remote debugging the app. I tried starting up the program and then closing my remote desktop connection and starting up the remote debugger with the remote desktop session ended. Didn't make a difference.