The IDirectDrawSurface3::GetAttachedSurface method obtains the attached surface that has the specified capabilities.
HRESULT GetAttachedSurface(
LPDDSCAPS lpDDSCaps,
LPDIRECTDRAWSURFACE3 FAR *lplpDDAttachedSurface
);
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_INVALIDOBJECT |
DDERR_INVALIDPARAMS |
DDERR_NOTFOUND |
DDERR_SURFACELOST |
Attachments are used to connect multiple DirectDrawSurface objects into complex structures, like the ones needed to support 3-D page flipping with z-buffers. This method fails if more than one surface is attached that matches the capabilities requested. In this case, the application must use the IDirectDrawSurface3::EnumAttachedSurfaces method to obtain the attached surfaces.
Windows NT: Use version 5.0 or later.
Windows: Use Windows 95 or later. Available as a redistributable for Windows 95.
Windows CE: Unsupported.
Header: Declared in ddraw.h.
Import Library: Use ddraw.lib.