I derived a class from CFileDialog and overrode the OnTypeChange() function in order to automatically change or append the new extension when the user changes the type dropdown similar to dialog in office. That part is working as expected. My problem is that when the user enters a filename with an invalid extension and clicks save, the correct extension is appended but it performs the file already exists check on the original filename and would not prompt the user.
For example: 1. Book1.xml.zip exists in the directory. 2. The .zip type is already selected in the file dialog. 3. The user types Book1.xml into the filename and clicks save. The filename is changed to Book1.xml.zip and returned as the filename but the user is never prompted to overwrite the file.
If I swap steps 2 and 3 so that the filename says Book1.xml.zip before saving then it would perform the check and display the prompt. If Book1.xml exists, then the user would be prompted to overwrite Book1.xml. I change the type in the OnFileNameOK() function before the base version but it seems to be too late.
Is there a way to call the default check or change the filename earlier like capturing the save button event