0
votes

I use Delphi XE2 on Windows 8. I have ported an D2009 application to XE2 and suddenly the save dialog (TSaveDialog) is very slow.

When Project/Options/Application/Runtime Themes is set to Enable Runtime Themes:

=>

When I open the save dialog the window freezes for about a minute (sometimes I can close the window but have to wait about a minute until I can open the dialog again (or another TOpenDialog). The new Vista style save dialog is shown.

If I try to run this exe on a PC with Windows 7, the app hangs upon start (I did also try with XP compatibility mode without success).

When Project/Options/Application/Runtime Themes set to none:

=>

Save dialog works well (fast) but the old style dialog is shown, se example below:

Example old style dialog

This exe works well on a PC with Windows 7 (though with the old style dialog).

Ps. My old exe-file compiled with D2009 on a Win 7 PC works however well on both the Win 7 and 8 PC:s, and shows the dialogs correctly using the new Vista dialog style.

Could it be some permission rights in Win 8/7 causing this? I use IDE FIX PACK 5.4,

Thanks, Thomas

1
is your windows fresh or anything is installed ? for example TeamViewer had interference with XE2 dialogs ( but it caused them lagging for few second on closing, not opening ) Perhaps even some videodrivers having features about managing layouts of windows like AMD HydraVision may potentially interfere - Arioch 'The
Does this happen in Release mode or Debug mode only? - user1593881
Does behaviour change if you run without IDE? - David Heffernan
Does it behave the same with a brand new project? - Sertac Akyuz
@Arioch 'The: The PC is about 1 year old and many things are installed but not the ones you mention. - Thomas

1 Answers

0
votes

I found what the problem is. I use {$MAXSTACKSIZE $4000000} and this causes the save dialogue to freeze for about a minute. The reason for this hefty stack size is that I use a recursive algorithm (that I now probably need to remake).

Reproduce as follows (XE2):

  1. Create a new VCL forms application
  2. Place a TSaveDialog1 on the form
  3. Place a Tbutton with OnClick event

`

Begin
   if SaveDialog1.Execute then    
     MessageDlg('ok', mtInformation,[mbOk], 0);
end;

`

4: Open the project source file and put the following rows:

//{$MAXSTACKSIZE $3500000} //this is a decimal value of 5 5574 528 OK!

{$MAXSTACKSIZE $4000000} //this is a decimal value of 6 7108 864 Not OK!

Run and click the button. Give a dummy file name and press save. Nothing happens. Keep on clicking the button for 60 seconds. The dialogue will finally close.

Change to the smaller stack size $3500000. Now the program works well. Thanks for all tips.