Platform SDK: DirectX |
The DirectDrawSurface7.GetDC method creates a GDI-compatible handle of a device context for the surface.
object.GetDC() As Long
If the method succeeds, it returns the handle to a device context.
If the method fails, it raises an error, and Err.Number can be set to one of the following values:
DDERR_DCALREADYCREATED |
DDERR_GENERIC |
DDERR_INVALIDOBJECT |
DDERR_INVALIDPARAMS |
DDERR_INVALIDSURFACETYPE |
DDERR_SURFACELOST |
DDERR_UNSUPPORTED |
DDERR_WASSTILLDRAWING |
This method uses an internal version of the DirectDrawSurface7.Lock method to lock the surface. The surface remains locked until the DirectDrawSurface7.ReleaseDC method is called.
ReleaseDC must be called from the same thread that called GetDC.