Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm getting a failure returned when calling Direct3DDevice->CreateDepthStencilSurface(). But rather than returning one of the values that the documentation says it should return (D3DERR_NOTAVAILABLE, D3DERR_INVALIDCALL, D3DERR_OUTOFVIDEOMEMORY, E_OUTOFMEMORY), it returns error code 80070057. What does this mean?

share|improve this question
up vote 5 down vote accepted

Use the DirectX Error Lookup tool that's found in the SDK.

Passing this value in it returns the following result:

HRESULT: 0x80070057 (2147942487)
Description: An invalid parameter was passed to the returning function
Severity code: Failed
Facility Code: FACILITY_WIN32 (7)
Error Code: 0x0057 (87)

You have an invalid argument passed into the function. Check the contents of your parameters.

share|improve this answer
+1 for keying me on to the error lookup tool. – J Junker Feb 3 '11 at 0:18
You may also find it useful to enable the Debug runtimes (via the DirectX control panel, which is accessible under the DX SDK's Start Menu entry). This will print some additional useful diagnostic information to the output window at runtime which can sometimes help clarify DX's otherwise-very-general error messages. – Josh Petrie Feb 3 '11 at 1:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.