Share via


IWMDMStorageControl::Move

banner art

The Move method moves a file on the IWMDMStorage object with which this instance of IWMDMStorageControl is associated.

Syntax

HRESULT Move(
  UINT  fuMode,
  IWMDMStorage*  pTargetObject,
  IWMDMProgress*  pProgress
);

Parameters

fuMode

[in]  Processing mode by which to invoke the Move operation and the type of move to make. Specify exactly one of the following two modes. If both modes are specified, block mode is used.

Mode Description
WMDM_MODE_BLOCK The operation will be performed using block mode processing. The call will not return until the operation is finished.
WMDM_MODE_THREAD The operation will be performed using thread mode processing. The call will return immediately, and the operation will be performed in a background thread.

The following table lists flags that indicate where the object will be moved to. One value from this table is combined with one value from the preceding Mode table using a bitwise OR.

Flag Description
WMDM_STORAGECONTROL_INSERTBEFORE The object will be inserted before the target object.
WMDM_STORAGECONTROL_INSERTINTO The object will be inserted into the target object.
WMDM_STORAGECONTROL_INSERTAFTER The object will be inserted after the target object.

pTargetObject

[in]  Pointer to the object before or after which you want to put the current object.

pProgress

[in]  Pointer to an IWMDMProgress interface that has been implemented by the application to track the progress of ongoing operations (optional; can be NULL).

Return Values

If the method succeeds, it retur All the interface methods in Windows Media Device Manager and service provider can return any of the following classes of error codes:

  • Standard COM error codes
  • Windows error codes converted to HRESULT values
  • Windows Media Device Manager error codes

For a complete list of possible error codes, see Error Codes.

Possible values include but are not limited to those in the following table:

Return code Description
WMDM_E_INTERFACEDEAD The file or folder was previously deleted.
E_BUSY The media device is already busy with another operation.
E_INVALIDARG Some of the input parameters are invalid or NULL.

Remarks

A file or directory can be moved only within the same root storage.

When using WMDM_MODE_THREAD, call IWMDMDevice::GetStatus after each file transfer to check for WMDM_STATUS_READY. This ensures the file operation is finished.

If an application uses WMDM_MODE_THREAD and passes a non-null pProgress parameter, the application must ensure that the object to which pProgress belongs is not destroyed until the move operation completes, because Windows Media Device Manager will send progress notifications to this object. This object can be destroyed only after it receives End notification. Failure to do this will result in access violations.

Requirements

Header: Defined in wmdm.idl.

Library: mssachlp.lib

See Also