I'm converting my AnsiString to a Pchar with 
TFileName.lpstrFile:=Pchar(DefaultFileName);
 
But I didn't understand the meaning of 
TFileName.nMaxFile:=100;  I thought it was the maximum number of files to
display or something.. not the maximum number of characters in the file
name. which it appears to be.
 
So now I have:
TFileName.nMaxFile:= Length(DefaultFileName)+1; 
TFileName.lpstrFile:=Pchar(DefaultFileName);
 
I need the +1 for the #0 at the end of the Pchar,  and now it works fine,
and I can have strings as long as they need to be.
 
Thank you for the help!
 
James
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to