[fpc-pascal] GetSaveFileNameA limited to 100 characters in default name

James Richters james.richters at productionautomation.net
Fri Jun 18 19:56:56 CEST 2021

I'm using GetSaveFileNameA() in a windows console program to obtain a
save-as directory and file name, I am passing  sending it a default file
name with:
DefaultFileName is an AnsiString that contains a full path and filename.
This all works fine as long as DefaultFileName is 100 characters or less,
if it's 101 or more, then GetSaveFileNameA() never opens a dialog box and
just returns False;
Does anyone know where the 100 character limit is coming from?  
TFileName.lpstrFile is a PChar, and DefaultFileName is an AnsiString,
Neither of which have a length limit that I know of.
I am doing a Writeln if Both DefaultFileName and TFileName.lpstrFile and
they both match, nothing is being truncated.  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20210618/6aaacef3/attachment-0001.htm>

More information about the fpc-pascal mailing list