Previous | Next |
The Delete method removes an object or objects from a storage medium on a media device.
Syntax
HRESULT Delete(
UINT fuMode,
IWMDMProgress* pProgress
);
Parameters
fuMode
[in] Flag that must always be set to WMDM_MODE_RECURSIVE.
If the object is a folder, it and its contents, and all subfolders and their contents are deleted.
If the object is a file, this parameter is ignored.
pProgress
[in] Pointer to an application-implemented IWMDMProgress interface that enables the application to receive progress notifications for lengthy deletion operations.
Return Values
If the method succeeds, it returns S_OK. If it fails, it returns an HRESULT error code.
Return code | Description |
WMDM_E_BUSY | The media device is busy. |
E_INVALIDARG | The mode specified is invalid. |
WMDM_E_INTERFACEDEAD | The file or folder was previously deleted. |
E_FAIL | An unspecified error occurred. |
Remarks
This method permanently removes the object(s) from the storage medium.
When using a compact flash card reader/writer with Windows Media Device Manager Service Provider, calling IMDSPObject::Delete immediately after IMDSPObject::Write sometimes fails. This happens because data written to a compact flash reader/writer is buffered by the driver of the card reader/writer. The Service Provider responds as if the write operations are complete, but the driver writes them out to the device according to its own schedule. IMDSPObject::Delete fails if the driver has not finished its writing operation.
See Also
Previous | Next |