IDirectDraw4::CreateSurface

The IDirectDraw4::CreateSurface method creates a DirectDrawSurface object for this DirectDraw object.

HRESULT CreateSurface(
  LPDDSURFACEDESC2 lpDDSurfaceDesc2,        
  LPDIRECTDRAWSURFACE4 FAR *lplpDDSurface,  
  IUnknown FAR *pUnkOuter                  
);
 

Parameters

lpDDSurfaceDesc2
Address of a DDSURFACEDESC2 structure that describes the requested surface. You should set any unused members of the DDSURFACEDESC2 structure to zero before calling this method. A DDSCAPS2 structure is a member of DDSURFACEDESC2.
lplpDDSurface
Address of a variable that will be set to a valid IDirectDrawSurface4 interface pointer if the call succeeds.
pUnkOuter
Allows for future compatibility with COM aggregation features. Presently, however, this method will return an error if this parameter is anything but NULL.

Return Values

If the method succeeds, the return value is DD_OK.

If the method fails, the return value may be one of the following error values:

DDERR_INCOMPATIBLEPRIMARY
DDERR_INVALIDCAPS
DDERR_INVALIDOBJECT
DDERR_INVALIDPARAMS
DDERR_INVALIDPIXELFORMAT
DDERR_NOALPHAHW
DDERR_NOCOOPERATIVELEVELSET
DDERR_NODIRECTDRAWHW
DDERR_NOEMULATION
DDERR_NOEXCLUSIVEMODE
DDERR_NOFLIPHW
DDERR_NOMIPMAPHW
DDERR_NOOVERLAYHW
DDERR_NOZBUFFERHW
DDERR_OUTOFMEMORY
DDERR_OUTOFVIDEOMEMORY
DDERR_PRIMARYSURFACEALREADYEXISTS
DDERR_UNSUPPORTEDMODE

QuickInfo

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in ddraw.h.
  Import Library: Use ddraw.lib.