Save as common file dialog not considering the save-as-file-type

210 views Asked by At

I have a requirement in my app where I need to set the File-name and extension programmatically with the Common save-as File dialog. But seems the save-as-File-type is not considered until changing the save-as-type on the dialog by manually. It takes the current type of opened file by default even though the save-as-type on dialog is different, and ask for overwriting the existing file. I have tried with parameters with OPENFILENAME struct, but couldn't resolve it.Any help is appreciated on this issue.

1

There are 1 answers

1
xMRi On

Leave the lpstrDefExt field empty.

If this field is filled, the Default will be used.