CFileDialog::OnShareViolation

Override this function to provide custom handling of share violations.

virtual UINT OnShareViolation(
   LPCTSTR lpszPathName 
);

Parameters

  • lpszPathName
    The path of the file on which the share violation occurred.

Return Value

One of the following values:

  • OFN_SHAREFALLTHROUGH   The filename is returned from the dialog box.

  • OFN_SHARENOWARN   No further action needs to be taken.

  • OFN_SHAREWARN   The user receives the standard warning message for this error.

Remarks

Normally, you do not need to use this function because the framework provides default checking of share violations and displays a message box if a share violation occurs.

If you want to disable share violation checking, use the bitwise OR operator to combine the flag OFN_SHAREAWARE with m_ofn.Flags.

Requirements

Header: afxdlgs.h

See Also

Reference

CFileDialog Class

Hierarchy Chart

CFileDialog::OnFileNameOK

Other Resources

CFileDialog Members