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

2021-06-21 Thread James Richters via fpc-pascal
>It's best to think of these in two parts. The Windows API part and then the >interfacing with Pascal part. >SaveAsFileName.lpstrFile = long pointer to a (C) string filename buffer >This buffer isn't created for you, you provide it and tell Windows it's size. Thank you for the explanation, that

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

2021-06-21 Thread Alexander Grotewohl via fpc-pascal
It's best to think of these in two parts. The Windows API part and then the interfacing with Pascal part. SaveAsFileName.lpstrFile = long pointer to a (C) string filename buffer This buffer isn't created for you, you provide it and tell Windows it's size. If you were to just do StrPLCopy(

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

2021-06-21 Thread James Richters via fpc-pascal
>I would prefer to use > StrPLCopy( SaveAsFileNameBuffer, DefaulSaveAsFileName, SizeOf(SaveAsFileNameBuffer)); >instead of >  SaveAsFileNameBuffer:=Pchar(DefaulSaveAsFileName); I'm curious what the difference is between StrPLCopy() and PChar() I wonder if PChar() was my problem.. maybe I don't

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

2021-06-21 Thread James Richters via fpc-pascal
I have it working better now. I was having a crash with Code 216 Appearantly SaveAsFileName.lpstrFile:= Pchar(DefaulSaveAsFileName); Just doesn't work the way I want it to. If I try to do the conversion to Pchar that way, I get an error 216 on:

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

2021-06-21 Thread James Richters via fpc-pascal
>It's curious, I'm not completely sure we are reasoning about the same function and record. It seems I should not be using TFilename as the variable name. I'm usinga variable called TFileName with GetSaveFileNameA() Here is the relevant code.. after I fixed it to use Max_Path Uses

Re: [fpc-pascal] How to check if a network is available?

2021-06-21 Thread Luca Olivetti via fpc-pascal
El 20/6/21 a les 19:38, Jean SUZINEAU via fpc-pascal ha escrit: Ping uses ICMP protocol. I don't have currently Indy installed on my machines, but I think you can find pascal components for ICMP client and even ICMP server. I think that this way you can do a single "ping", a single ICMP