IWMWriterPushSink::Connect method (wmsdkidl.h)
[The feature associated with this page, Windows Media Format 11 SDK, is a legacy feature. It has been superseded by Source Reader and Sink Writer. Source Reader and Sink Writer have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use Source Reader and Sink Writer instead of Windows Media Format 11 SDK, 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 to a publishing point on a Windows Media server.
Syntax
HRESULT Connect(
[in] LPCWSTR pwszURL,
[in] LPCWSTR pwszTemplateURL,
[in] BOOL fAutoDestroy
);
Parameters
[in] pwszURL
Wide-character string that contains the URL of the publishing point on the Windows Media server. For example, if the URL is "http://MyServer/MyPublishingPoint", the push sink connects to the publishing point named MyPublishingPoint on the server named MyServer. The default port number is 80. If the server is using a different port, specify the port number in the URL. For example, "http://MyServer:8080/MyPublishingPoint" specifies port number 8080.
[in] pwszTemplateURL
Optional wide-character string that contains the URL of an existing publishing point to use as a template. This parameter can be NULL.
[in] fAutoDestroy
Boolean value that specifies whether to remove the publishing point after the push sink disconnects from the server.
Return value
The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Return code | Description |
---|---|
|
The method succeeded. |
|
The method failed. |
|
Invalid argument; pwszURL cannot be NULL. |
|
Insufficient memory. |
|
Host name is not valid. |
Remarks
If the publishing point specified in pwsURL does not exist, the server creates a new publishing point. The caller must have write and create permissions on the server. The new publishing point has the same configuration as the publishing point specified in the pwszTemplateURL parameter. If pwszTemplateURL is NULL, the new publishing point has the same configuration as the server's default publishing point.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 2000 Professional [desktop apps only],Windows Media Format 9 Series SDK, or later versions of the SDK |
Minimum supported server | Windows 2000 Server [desktop apps only] |
Target Platform | Windows |
Header | wmsdkidl.h (include Wmsdk.h) |
Library | Wmvcore.lib; WMStubDRM.lib (if you use DRM) |