aGetfiles bug
aGetfiles bug
I will using aGetfiles(). Now i see, that a selection over 15 files not possible. Over 15 files is a error "Abnormal program termination" or the program freezes!
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: aGetfiles bug
Thanks! Any solution in the future?
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: aGetfiles bug
Günther,
In FWH getfile.c source code there is a:
#define SIZE_IN_BYTES 15384
Please try to increase its size and test it again, thanks
In FWH getfile.c source code there is a:
#define SIZE_IN_BYTES 15384
Please try to increase its size and test it again, thanks
Re: aGetfiles bug
Antonio, the problem is not the number (15 is enough) of selectable files, it is the crash from the app!!!
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: aGetfiles bug
Surely because it runs out of memory, thus try to increase that number...
Re: aGetfiles bug
Antonio, i have enough of memory. See so select in windows files to delete! We can select thousands of files...
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: aGetfiles bug
Günther,
Please provide the instructions or a GIF showing how to reproduce the crash, thanks
Please provide the instructions or a GIF showing how to reproduce the crash, thanks
Re: aGetfiles bug
Antonio, not in all cases a insert (Abnormal program termination) is shown, in some cases the program is ending without any report! I cannot reproduce the situation. < 15 files it seems to functioning.
This is in hb_out.log
This is in hb_out.log
Application Internal Error - C:\WGUN\GUN1\gun32.exe
Terminated at: 2019-01-19 19:38:54
Unrecoverable error 6005: Exception error:
Exception Code:C0000005 ACCESS_VIOLATION
Exception Address:0094AFA4
EAX:00310030 EBX:00CD3DC0 ECX:40000000 EDX:005F0037
ESI:006AFEF0 EDI:00000000 EBP:0014E108
CS:EIP:001B:0094AFA4 SS:ESP0014E0A0
DS:0023 ES:0023 FS:003B GS:0000
Flags:00010206
Exception Parameters: 00000000 00310034
CS:EIP: 8B 50 04 83 E2 F8 2B 55 0C 3B F2 76 09 89 45 FC
SS:ESP: 04B4CA58 00CD3DC0 00000110 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
…
…
Called from CGETFILE(0)
Called from AGETFILES(21) in .\source\winapi\GETFILES.PRG
- Giovany Vecchi
- Posts: 129
- Joined: Mon Jun 05, 2006 9:39 pm
- Location: Brasil
Re: aGetfiles bug
Edit the file getfile.c at line 365 and 366. Change the values.
Code: Select all
//pFile = fw_parWideLen( 8, 512 );
//pFilter = fw_parWideLen( 1, 800 );
pFile = fw_parWideLen( 8, 4096 );
pFilter = fw_parWideLen( 1, 2400 );
Re: aGetfiles bug
Thank you, Giovany! But i have the problem at aGetfiles() for selecting more files than one!
I think, the error comes from this lines in getfile.c (line 141...). There are not enough memory reserved for the files selected.
Antonio, please look.
I think, the error comes from this lines in getfile.c (line 141...). There are not enough memory reserved for the files selected.
Antonio, please look.
Code: Select all
pFile = ( LPSTR ) hb_xgrab( ( dwFlags & OFN_ALLOWMULTISELECT ) ? SIZE_IN_BYTES : 256 ); //too small for many files??
if ( hb_pcount() > 7 && HB_ISCHAR( 8 ) ) //this is size from inifile, for what??
{
wLen = min( ( unsigned long ) 255, hb_parclen( 8 ) );
memcpy( pFile, ( char * ) hb_parc( 8 ), wLen );
}
else
{
wLen = min( ( unsigned long ) 255, hb_parclen( 1 ) ); //this is size from mask, for what??
memcpy( pFile, ( char * ) hb_parc( 1 ), wLen );
}
* ( pFile + wLen ) = 0;
Re: aGetfiles bug
Oh, sorry, i found in this moment, that the function is same as cgetfile()! I will try!
Re: aGetfiles bug
Can not compiling as i cannot find the c-function fw_wcslen()!?
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: aGetfiles bug
I am checking it but it keeps GPFing for a very large amount of files
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: aGetfiles bug
Only solution is to increase SIZE_IN_BYTES.
The limit is not the number of files. Size of text holding folder and file names.
This buffer should accommodate the directory names and file names selected.
There is always a finite limit.
No other changes are required
The limit is not the number of files. Size of text holding folder and file names.
This buffer should accommodate the directory names and file names selected.
There is always a finite limit.
No other changes are required
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India