thank you for the hint. The ExtendedPrefix (\\?\) removes the MAX_PATH restriction. The following code works fine to me:
ImageEnView.PdfViewer.LoadFromFile(VerifyPath(Path));
function TfMain.VerifyPath(Path: String): String;
begin
if NOT Path.StartsWith('\\') AND (Length(Path) > 255) then
Result := '\\?\' + Path;
end;
Ale
xequte
Posted - Sep 04 2024 : 16:14:48 Hi Ale
Well, I think the real issue is that Windows controls will not load a file with a path > 255 characters. The workaround would be to use the short form version of the filename. See the Windows function, GetShortPathName.