aGetfiles bug

User avatar
byte-one
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria
Contact:

aGetfiles bug

Post by byte-one »

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!
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: aGetfiles bug

Post by nageswaragunupudi »

Yes
That is the present limitation.
Regards

G. N. Rao.
Hyderabad, India
User avatar
byte-one
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria
Contact:

Re: aGetfiles bug

Post by byte-one »

Thanks! Any solution in the future?
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: aGetfiles bug

Post by Antonio Linares »

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
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
byte-one
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria
Contact:

Re: aGetfiles bug

Post by byte-one »

Antonio, the problem is not the number (15 is enough) of selectable files, it is the crash from the app!!!
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: aGetfiles bug

Post by Antonio Linares »

Surely because it runs out of memory, thus try to increase that number...
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
byte-one
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria
Contact:

Re: aGetfiles bug

Post by byte-one »

Antonio, i have enough of memory. See so select in windows files to delete! We can select thousands of files...
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: aGetfiles bug

Post by Antonio Linares »

Günther,

Please provide the instructions or a GIF showing how to reproduce the crash, thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
byte-one
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria
Contact:

Re: aGetfiles bug

Post by byte-one »

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
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:ESP:0023:0014E0A0
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
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
Giovany Vecchi
Posts: 129
Joined: Mon Jun 05, 2006 9:39 pm
Location: Brasil

Re: aGetfiles bug

Post by Giovany Vecchi »

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 );

 
User avatar
byte-one
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria
Contact:

Re: aGetfiles bug

Post by byte-one »

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.

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;
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria
Contact:

Re: aGetfiles bug

Post by byte-one »

Oh, sorry, i found in this moment, that the function is same as cgetfile()! I will try!
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria
Contact:

Re: aGetfiles bug

Post by byte-one »

Can not compiling as i cannot find the c-function fw_wcslen()!?
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: aGetfiles bug

Post by Antonio Linares »

I am checking it but it keeps GPFing for a very large amount of files
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: aGetfiles bug

Post by nageswaragunupudi »

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
Regards

G. N. Rao.
Hyderabad, India
Post Reply