IFileDialogEvents::OnShareViolation method

Enables an application to respond to sharing violations that arise from Open or Save operations.

Syntax

HRESULT OnShareViolation(
  IFileDialog                 *pfd,
  IShellItem                  *psi,
  FDE_SHAREVIOLATION_RESPONSE *pResponse
);

Parameters

pfd

Type: IFileDialog*

A pointer to the interface that represents the dialog.

psi

Type: IShellItem*

A pointer to the interface that represents the item that has the sharing violation.

pResponse

Type: FDE_SHAREVIOLATION_RESPONSE*

A pointer to a value from the FDE_SHAREVIOLATION_RESPONSE enumeration indicating the response to the sharing violation.

Return value

Type: HRESULT

The implementer should return E_NOTIMPL if this method is not implemented; S_OK or an appropriate error code otherwise.

Remarks

The FOS_SHAREAWARE flag must be set through IFileDialog::SetOptions before this method is called.

A sharing violation could possibly arise when the application attempts to open a file, because the file could have been locked between the time that the dialog tested it and the application opened it.

Requirements

   
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header shobjidl_core.h (include Shobjidl.h)