Skip to content

Make SaveFileDialog support NOTESTFILECREATE. #870

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
DinoChan opened this issue Jun 5, 2019 · 2 comments
Closed

Make SaveFileDialog support NOTESTFILECREATE. #870

DinoChan opened this issue Jun 5, 2019 · 2 comments
Labels
Enhancement Requested Product code improvement that does NOT require public API changes/additions

Comments

@DinoChan
Copy link

DinoChan commented Jun 5, 2019

Needs to stop SaveFileDialog from creating an empty file.

The problem for us is that we have configured the file system security so that a file can be created and filled with data, but once it has been closed, it may not be modified or deleted (by a regular user). When our application tries to use file name returned by the SaveFileDialog, that file already exists and we get the following error when we try to fill it with data: “You don’t have permission to modify files in this network location.”

@grubioe grubioe added the Enhancement Requested Product code improvement that does NOT require public API changes/additions label Jun 6, 2019
@grubioe grubioe added this to the Future milestone Jun 6, 2019
@grubioe grubioe self-assigned this Jun 6, 2019
@grubioe grubioe removed their assignment Jul 24, 2019
@lindexi
Copy link
Member

lindexi commented Apr 7, 2020

Because the SaveFileDialog will create a test file to test something and then delete the test file. See GetSaveFileNameA function (commdlg.h) - Win32 apps | Microsoft Docs and OPENFILENAMEA (commdlg.h) - Win32 apps | Microsoft Docs

But the Options is get only that we can not set the OFN_NOTESTFILECREATE flag.

protected int Options
{
get
{
return _dialogOptions.Value & (NativeMethods.OFN_READONLY | NativeMethods.OFN_HIDEREADONLY |
NativeMethods.OFN_NOCHANGEDIR | NativeMethods.OFN_NOVALIDATE |
NativeMethods.OFN_ALLOWMULTISELECT | NativeMethods.OFN_PATHMUSTEXIST |
NativeMethods.OFN_NODEREFERENCELINKS);
}
}

@pchaurasia14
Copy link
Member

This enhancement has been implemented in .NET 8.

Reference - Link

Hence closing this issue.

@ghost ghost removed this from the Future milestone Aug 30, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Sep 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Enhancement Requested Product code improvement that does NOT require public API changes/additions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants