IDirectDrawSurface::GetDC

HRESULT GetDC(HDC FAR * lphDC);

Creates a GDI-compatible hDC for the surface.

·Returns DD_OK if successful, or one of the following error values otherwise:

DDERR_DCALREADYCREATED DDERR_GENERIC

DDERR_INVALIDOBJECT DDERR_INVALIDPARAMS

DDERR_INVALIDSURFACETYPE DDERR_SURFACELOST

DDERR_UNSUPPORTED DDERR_WASSTILLDRAWING

lphDC

Address of the returned hDC.

This method uses an internal version of the IDirectDrawSurface::Lock method to lock the surface, and the surface will remain locked until the IDirectDrawSurface::ReleaseDC method is called. For more information, see the description of the IDirectDrawSurface::Lock method.