IDirectDrawSurface2::GetDC

HRESULT GetDC(HDC FAR * lphDC);

Creates a GDI-compatible handle of a device context 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 for the returned handle of a device context.

This method uses an internal version of the IDirectDrawSurface2::Lock method to lock the surface. The surface remains locked until the IDirectDrawSurface2::ReleaseDC method is called.