aGetfiles bug

aGetfiles bug

Postby byte-one » Thu Jan 17, 2019 10:49 pm

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
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: aGetfiles bug

Postby nageswaragunupudi » Thu Jan 17, 2019 11:07 pm

Yes
That is the present limitation.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: aGetfiles bug

Postby byte-one » Thu Jan 17, 2019 11:11 pm

Thanks! Any solution in the future?
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: aGetfiles bug

Postby Antonio Linares » Fri Jan 18, 2019 6:04 pm

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
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: aGetfiles bug

Postby byte-one » Fri Jan 18, 2019 9:51 pm

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
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: aGetfiles bug

Postby Antonio Linares » Sat Jan 19, 2019 9:05 am

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: aGetfiles bug

Postby byte-one » Sat Jan 19, 2019 5:52 pm

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
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: aGetfiles bug

Postby Antonio Linares » Sat Jan 19, 2019 6:13 pm

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
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: aGetfiles bug

Postby byte-one » Sat Jan 19, 2019 6:50 pm

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
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: aGetfiles bug

Postby Giovany Vecchi » Wed Feb 13, 2019 5:59 am

Edit the file getfile.c at line 365 and 366. Change the values.

Code: Select all  Expand view

  //pFile = fw_parWideLen( 8, 512 );
  //pFilter = fw_parWideLen( 1, 800 );
  pFile = fw_parWideLen( 8, 4096 );
  pFilter = fw_parWideLen( 1, 2400 );

 
User avatar
Giovany Vecchi
 
Posts: 207
Joined: Mon Jun 05, 2006 9:39 pm
Location: Brasil

Re: aGetfiles bug

Postby byte-one » Wed Feb 13, 2019 9:49 am

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  Expand view
  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

Re: aGetfiles bug

Postby byte-one » Wed Feb 13, 2019 10:17 am

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

Re: aGetfiles bug

Postby byte-one » Wed Feb 13, 2019 11:02 am

Can not compiling as i cannot find the c-function fw_wcslen()!?
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: aGetfiles bug

Postby Antonio Linares » Wed Feb 13, 2019 11:14 am

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: aGetfiles bug

Postby nageswaragunupudi » Wed Feb 13, 2019 11:23 am

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
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 103 guests