GetAttachedSurface Method

IDirectDrawSurface7::GetAttachedSurface method

Obtains the attached surface that has the specified capabilities, and increments the reference count of the retrieved interface.

Syntax


HRESULT GetAttachedSurface(
  [in]  LPDDSCAPS2               lpDDSCaps,
  [out] LPDIRECTDRAWSURFACE7 FAR *lplpDDAttachedSurface
);

Parameters

lpDDSCaps [in]

A pointer to a DDSCAPS2 structure that indicates the hardware capabilities of the attached surface.

lplpDDAttachedSurface [out]

A pointer to a variable to receive a pointer to the retrieved surface's IDirectDrawSurface7 interface. The retrieved surface is the one that matches the description, according to the lpDDSCaps parameter.

Return value

If the method succeeds, the return value is DD_OK.

If it fails, the method can return one of the following error values:

  • DDERR_INVALIDOBJECT
  • DDERR_INVALIDPARAMS
  • DDERR_NOTFOUND
  • DDERR_SURFACELOST

Remarks

Attachments are used to connect multiple DirectDrawSurface objects into complex structures, like the complex structures required to support 3-D page flipping with z-buffers. GetAttachedSurface fails if more than one surface is attached that matches the capabilities requested. In this case, the application must use the IDirectDrawSurface7::EnumAttachedSurfaces method to obtain the attached surfaces.

You must use LoadLibrary to explicitly link to Ddraw.dll and then use GetProcAddress to access the GetAttachedSurface method.

Requirements

Header

Ddraw.h

Library

Ddraw.lib

DLL

Ddraw.dll

See also

IDirectDrawSurface7

 

 

Show:
© 2016 Microsoft