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

Jean SUZINEAU jean.suzineau at wanadoo.fr
Mon Jun 21 07:27:51 CEST 2021


Le 21/06/2021 à 03:04, James Richters a écrit :
> Var
>     ...
> DefaulSaveAsFileName: Ansistring;
>
> SaveAsFileNameBuffer: array[0..Max_Path+1] of char;
>
>    ...
>
> Begin
>
> DefaulSaveAsFileName := 'X:\Something with a really really really long 
> long long long file name to see if there is still a bug with really 
> long filenames.tap';
>
> ...
> SaveAsFileNameBuffer:=Pchar(DefaulSaveAsFileName);
> ...
This sounds a bit odd to me but it seems to work.
I would prefer to use

   StrPLCopy( SaveAsFileNameBuffer, DefaulSaveAsFileName, 
SizeOf(SaveAsFileNameBuffer));

instead of
SaveAsFileNameBuffer:=Pchar(DefaulSaveAsFileName);


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20210621/b6211981/attachment-0001.htm>


More information about the fpc-pascal mailing list