Microsoft DirectX 9.0

IDirectDrawSurface::GetDC

The GetDC method creates a GDI-compatible device context for the surface. It uses an internal version of the Lock method to lock the surface, and the surface will remain locked until ReleaseDC is called. See the description of the Lock method for more information on this behavior.

Syntax

HRESULT GetDC(
  HDCFAR *lphDC
  );

Parameters

lphDC

Points to the device context returned.

Return Values

Value Description
DD_OK The method succeeded.
DDERR_INVALIDOBJECT DirectDraw received a pointer that was an invalid DirectDraw object.
DDERR_INVALIDPARAMS One or more of the input parameters is invalid.
DDERR_SURFACELOST Access to this surface is being refused because the surface memory is gone. The DirectDrawSurface object representing this surface should have Restore called on it.
DDERR_WASSTILLDRAWING Informs DirectDraw that the previous Blt which is transfering information to or from this Surface is incomplete.
DDERR_GENERIC Generic failure.
DDERR_UNSUPPORTED Action not supported.

See Also