IWMPConvert::ConvertFile method (wmpservices.h)
[The feature associated with this page, Windows Media Player SDK, is a legacy feature. It has been superseded by MediaPlayer. MediaPlayer has been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer instead of Windows Media Player SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]
The ConvertFile method is implemented by a conversion plug-in and called by Windows Media Player to enable a conversion plug-in to convert a digital media file into ASF.
Syntax
HRESULT ConvertFile(
[in] BSTR bstrInputFile,
[in] BSTR bstrDestinationFolder,
[out] BSTR *pbstrOutputFile
);
Parameters
[in] bstrInputFile
BSTR containing the path to the file to be converted.
[in] bstrDestinationFolder
BSTR containing that path to the folder where the converted file must be copied.
[out] pbstrOutputFile
Pointer to a BSTR that receives the path to the converted file.
Return value
The method returns an HRESULT. The following table lists recommended return codes.
Return code/value | Description |
---|---|
|
Unspecified failure while converting the file. |
|
The license prohibits file conversion. IWMPConvert::GetErrorURL must return the URL of the webpage that describes the issue. |
|
The license prohibits file conversion. There is no error URL available. |
|
The specified file is corrupted. |
|
There is an unspecified problem with the plug-in. IWMPConvert::GetErrorURL must return the URL of the webpage where the user can reinstall the plug-in. |
|
There is an unspecified problem with the plug-in. There is no error URL available. |
|
This conversion plug-in is not the correct one to convert the current file. |
Remarks
This is a synchronous call. Your code must complete and return as quickly as possible. This method is not intended to be used for transcoding digital media files. You should use this method only to change the file format.
Windows Media Player 10 Mobile: This method is not supported.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Media Player, build 10.00.00.4521 or later |
Target Platform | Windows |
Header | wmpservices.h |