### IDirectDrawVideoPort::SetTargetSurface

The IDirectDrawVideoPort::SetTargetSurface method sets the DirectDraw surface object that will receive the stream of live video data and/or the vertical blank interval data.

HRESULT SetTargetSurface(

LPDIRECTDRAWSURFACE lpDDSurface,

DWORD dwFlags

);

##### Parameters

lpDDSurface
  Address of the DirectDrawSurface object that will receive the video data.
dwFlags
  Value specifying the type of target surface.

  DDVPTARGET_VIDEO | The specified surface should receive the normal video data and vertical interval data unless a separate surface was attached for this purpose.
  DDVPTARGET_VBI | The specified surface should receive the data within the vertical blanking interval.

##### 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_INVALIDOBJECT
DDERR_INVALIDPARAMS

##### See Also

IDirectDrawVideoPort::StartVideo, IDirectDrawVideoPort::StopVideo, IDirectDrawVideoPort::UpdateVideo