DirectX SDK

DirectDrawSurface7.IsLost

The DirectDrawSurface7.IsLost method determines whether the surface memory associated with a DirectDrawSurface object has been freed.

object.IsLost() As Long

Parameters

object
Object expression that resolves to a DirectDrawSurface7 object.

Return Values

If the method succeeds, it returns 0 (False), indicating that the surface has not been freed and nonzero if it has been freed.

Error Codes

If the method fails, it raises an error, and Err.Number can be set to one of the following values:

DDERR_INVALIDOBJECT
DDERR_INVALIDPARAMS
DDERR_SURFACELOST

Remarks

You can use this method to find out whether you need to reallocate surface memory by calling the DirectDrawSurface7.Restore method. When a DirectDrawSurface object loses its surface memory, most methods return DDERR_SURFACELOST and perform no other action.

Surfaces can lose their memory when the mode of the display card is changed or an application receives exclusive access to the display card and frees all surface memory currently allocated on the display card.

See Also

DirectDrawSurface7.Restore, Losing and Restoring Surfaces