Using Delphi Seattle in W7 x64. When using a custom VCL style and you select a large amount of files (like 2-3k+), the filenames are corrupted. Without a custom style this doesn't happen.
program Project1;
uses
Vcl.Forms,
Unit1 in 'Unit1.pas' {Form1},
Vcl.Themes,
Vcl.Styles;
{$R *.res}
begin
Application.Initialize;
Application.MainFormOnTaskbar := True;
TStyleManager.TrySetStyle('Onyx Blue');
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
procedure TForm1.FormCreate(Sender: TObject);
Var s: string;
ts: TStringList;
begin
if OpenDialog1.Execute then begin
ts := TStringList.Create;
for s in OpenDialog1.Files do
ts.Add(s);
end else Exit;
ts.SaveToFile('z:\files.txt');
ts.Free;
end;
object OpenDialog1: TOpenDialog
Filter = 'Pictures (jpg,png,bmp,gif)|*.jpg;*.png;*.bmp;*.gif|All Files|*.*'
Options = [ofReadOnly, ofAllowMultiSelect, ofEnableSizing, ofForceShowHidden]
Title = 'Select files to upload'
Left = 201
Top = 64
end
On my end, this code results in only 769 files written to the log out of ~5000, and their initial path "z:" gets corrupted with other characters "?"
Any way to fix this?
Note: the new TFileOpenDialog does not seem to have this issue, however it does bring others as shown here: (besides being Vista+)
TFileOpenDialog
manages to do it. But with non-standard VCL styles it has to override default Windows style and falls to limited pre-Vista modes. Try to install Windows 2000/XP and try the program there even without styles. Chances are it will only work with Vista+ anyway, so you would have no reason to avoid usingTFileOpenDialog
- Arioch 'The