2

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.

Community
  • 1
  • 1
Arnold
  • 4,578
  • 6
  • 52
  • 91
  • If you create another app with just the savedialog, does the IDE behave the same way? – vickd Apr 01 '12 at 11:29
  • 1
    Probably a shell extension that gags when run under a debugger. I've experienced similar. Try on a clean windows install. – David Heffernan Apr 01 '12 at 11:48
  • Also what OS version ? it might have to do with windows shell extension interaction. – menjaraz Apr 01 '12 at 11:53
  • @DavidHeffeman, suppose it is a shell extension gag, it would apply to all projects being run from the IDE, not only this one. I tested other projects and they work fine. – Arnold Apr 01 '12 at 13:49
  • Can't you examine all the settings that are in Debug that are different from Release? Changed values from "Base" appear in bold. Should not be so difficult to find them. – EMBarbosa Apr 02 '12 at 14:28
  • @EMBarbossa, it doesn't show when run from the IDE, whatever configuration I choose. The Dialogs only show when run stand-alone, directly from windows explorer. – Arnold Apr 02 '12 at 15:52

1 Answers1

6

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.

Andreas Hausladen
  • 8,081
  • 1
  • 41
  • 44
  • I should have mentioned using Delphi XE, the question has been updated. I presume the IDE Fix Pack does not apply to this situation? – Arnold Apr 01 '12 at 13:52
  • 1
    Anyhow, your website makes interesting reading. I didn't know that Delphi was such a time bomb :-). I installed IDE Fix pack and see whether it improves the Delphi experience. Thanks for pointing me at it! – Arnold Apr 01 '12 at 18:49