IWMReaderAdvanced2::SaveFileAs 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 SaveFileAs method saves the current file.
Syntax
HRESULT SaveFileAs(
[in] const WCHAR *pwszFilename
);
Parameters
[in] pwszFilename
Pointer to a wide-character null-terminated string containing the file name.
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 file was closed before the operation completed. A WMT_SAVEAS_STOP event is also generated in this case. |
|
The call to this method has been made before an Open call. |
|
A previous SaveFileAs operation has not yet been completed. Saving files is sequential. |
|
The play mode is not WMT_PLAY_MODE_DOWNLOAD. |
|
There is not enough free disk space. See the note in the Remarks below. |
Remarks
This method can be used to save the content downloaded from a Web server to the local hard disk. Files can be saved when the reader is downloading from a Web server.
You can use this method to save a server-side playlist. When you do so, you specify the name to use for the playlist, and each file in the playlist will be saved automatically.
This operation is asynchronous; WMT_SAVEAS_STOP indicates that all the data has been saved. Closing the reader ends a save operation that has not been completed.
This method can take some time to complete, and a call can be made to GetSaveAsProgress to determine progress.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 2000 Professional [desktop apps only],Windows Media Format 7 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) |