在W7 x64中使用德爾福西雅圖。當使用自定義VCL風格並且選擇大量文件(如2-3k +)時,文件名會被損壞。沒有自定義樣式,這不會發生。德爾福:TOpenDialog + VCL樣式文件大量損壞文件
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
我的結束,在只有769文件驗證碼結果寫入日誌出來〜5000,以及它們的初始路徑「Z:」它和其它字符損壞「?」
有什麼辦法解決這個問題?
注:新TFileOpenDialog似乎不存在此問題,但它確實帶來其他如下所示:(除了是Vista的+)
如果你不使用自定義VCL風格 - 它會不同? –
工作正常,沒有自定義樣式。 – hikari
我的賭注是沒有自定義風格的對話框進入標準的Windows Vista + API調用路徑,並像'TFileOpenDialog'設法做到這一點。但是對於非標準的VCL風格,它必須覆蓋默認的Windows風格,並且會降低到Vista之前的有限模式。嘗試安裝Windows 2000/XP,並嘗試沒有樣式的程序。有機會,它只能用於Vista +無論如何,所以你將沒有理由避免使用TFileOpenDialog' –