I have a form with a TSaveDialog. When calling the Execute function it does not popup when running from the IDE. It does popup when running stand-alone. Testing it somewhat more I found that all TSave/TOpen dialogs don't work. Not working means that Execute returns False
without a popup (see updated code example: always the message 'False' pops up without being preceded by the Dialog). The other dialogs (font/color/etc.) do work.
procedure TForm1.Button1Click(Sender: TObject);
begin
if OpenPictureDialog1.Execute
then ShowMessage ('True')
else ShowMessage ('False');
end;
When run-without-debugging the dialog neither comes up. It also does not matter whether a Release or Debug configuration is selected.
Apparently the IDE does something weird. There are two TSaveDialog components on the form and both display the same behavior.
Any idea what is wrong?
Update 1 using Delphi XE on Windows 7. Other projects using TSaveDialogs work fine.
Update 2 Found out that the original question about TSaveDialog applied to all TSave/TOpen dialogs. Question has been edited to include this knowledge.
Update 3 I found this link of a similar error. However, I checked the registry but could not find an executable as mentioned. And the tip to change the compatibility to XP does not apply imho because the TSaveDialog works fine outside the IDE.
If you are using XE2 then you should check that you do not have any entries in the "User overrides" of the Project Options Environment block. The "Include System Variables" isn't working and without it, only the user overridden environment variables are in the environment block with that the EXE is started, But the open/save dialog require some of the system variables like "SystemDrive" and "SystemRoot".
Alternatively you can install the IDE Fix Pack that fixes the "Include System Variables" option.