IDirectDrawSurface7::GetDC method

Creates a GDI-compatible handle of a device context for this surface.

Syntax


HRESULT GetDC(
  [out]  HDC FAR *lphDC
);

Parameters

lphDC [out]

A pointer to a variable that receives the handle of the device context for this surface.

Return value

If the method succeeds, the return value is DD_OK.

If it fails, the method can return one of the following error values:

  • DDERR_DCALREADYCREATED
  • DDERR_GENERIC
  • DDERR_INVALIDOBJECT
  • DDERR_INVALIDPARAMS
  • DDERR_INVALIDSURFACETYPE
  • DDERR_SURFACELOST
  • DDERR_UNSUPPORTED
  • DDERR_WASSTILLDRAWING

Remarks

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

You must use LoadLibrary to explicitly link to Ddraw.dll and then use GetProcAddress to access the GetDC method.

Requirements

Header

Ddraw.h

Library

Ddraw.dll

See also

IDirectDrawSurface7

 

 

Community Additions

ADD
Show:
© 2014 Microsoft