DirectX SDK |
The DirectDrawSurface7.IsLost method determines whether the surface memory associated with a DirectDrawSurface object has been freed.
object.IsLost() As Long
If the method succeeds, it returns 0 (False), indicating that the surface has not been freed and nonzero if it has been freed.
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 |
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.