IGraphBuilder::Connect method (strmif.h)

[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The Connect method connects the two pins, using intermediates if necessary.

Syntax

HRESULT Connect(
  [in] IPin *ppinOut,
  [in] IPin *ppinIn
);

Parameters

[in] ppinOut

Pointer to the IPin interface on the output pin.

[in] ppinIn

Pointer to the IPin interface on the input pin.

Return value

Returns an HRESULT. Possible values include the following.

Return code Description
S_OK
Success.
VFW_S_PARTIAL_RENDER
Partial success; some of the streams from this pin use an unsupported format.
E_ABORT
Operation aborted.
E_POINTER
NULL pointer argument.
VFW_E_CANNOT_CONNECT
No combination of intermediate filters could be found to make the connection.
VFW_E_NOT_IN_GRAPH
At least one of the filters is not in the filter graph.

Remarks

This method connects two pins directly or indirectly, adding intermediate filters if necessary. The method starts by attempting a direct connection. If that fails, it tries to use any filters that are already in the filter graph and have unconnected input pins. (It enumerates these in an arbitrary order.) If that fails, it searches for filters in the registry, and tries them in order of merit. For more information, see Intelligent Connect.

During the connection process, the Filter Graph Manager ignores pins on intermediate filters if the pin name begins with a tilde (~). For more information, see PIN_INFO.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header strmif.h (include Dshow.h)
Library Strmiids.lib

See also

Error and Success Codes

IGraphBuilder Interface