DirectX SDK

DirectDraw7.DuplicateSurface

The DirectDraw7.DuplicateSurface method duplicates a DirectDrawSurface7 object.

object.DuplicateSurface( _ 
    ddIn As DirectDrawSurface7) As DirectDrawSurface7

Parameters

object
Object expression that resolves to a DirectDraw7 object.
ddIn
DirectDrawSurface7 object that is the surface to be duplicated.

Return Values

If the method succeeds, it returns a newly duplicated DirectDrawSurface7 object.

Error Codes

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

DDERR_CANTDUPLICATE
DDERR_INVALIDOBJECT
DDERR_INVALIDPARAMS
DDERR_OUTOFMEMORY
DDERR_SURFACELOST

Remarks

This method creates a new DirectDrawSurface7 object that points to the same surface memory as an existing DirectDrawSurface object. This duplicate can be used just like the original object. The surface memory is released after the last object that refers to it is released. A primary surface, 3-D surface or implicitly created surface cannot be duplicated.