Problem with aGetFiles()

Problem with aGetFiles()

Postby Taavi » Wed Oct 06, 2010 11:35 am

Hello,
there seems to be a problem with new function aGetFiles() introduced in FWH 10.9.
At some file count (or maybe return string length) function cgetfile() call used in this function returns just emtpy string. User reported problem on XP, tested and problem exists also on Windows 7/64.

Taavi.
Taavi
 
Posts: 89
Joined: Mon Nov 21, 2005 10:29 am

Re: Problem with aGetFiles()

Postby Antonio Linares » Mon Oct 11, 2010 11:02 am

Taavi,

What parameters are you supplying to the function ?
regards, saludos

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

Re: Problem with aGetFiles()

Postby Taavi » Mon Oct 11, 2010 11:29 am

Hi,
I tested with code:

if len(afailid:=agetfiles('Testfiles | *.dbf' ,'Please select files.'))==0
teade('Import katkestatud.')
return
endif

aeval(afailid,{|x| alert(x) })

Works when selecting 10 ..15 files, with 20 files selected returns empty array. Filenames with path are approx. 50 characters each.

Taavi.
Taavi
 
Posts: 89
Joined: Mon Nov 21, 2005 10:29 am

Re: Problem with aGetFiles()

Postby Antonio Linares » Mon Oct 11, 2010 11:47 am

Taavi,

In function cGetFile() we use this amount of memory to be allocated: (5128)

pFile = ( LPSTR ) _xgrab( ( dwFlags & OFN_ALLOWMULTISELECT ) ? 5128 : 256 );

Please increase it (double or triple) and try it again, thanks :-)
regards, saludos

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

Re: Problem with aGetFiles()

Postby Taavi » Tue Oct 12, 2010 1:19 pm

Hi, tryed with

pFile = ( LPSTR ) hb_xgrab( ( dwFlags & OFN_ALLOWMULTISELECT ) ? 15384 : 256 );

No changes.
Taavi


Antonio Linares wrote:Taavi,

In function cGetFile() we use this amount of memory to be allocated: (5128)

pFile = ( LPSTR ) _xgrab( ( dwFlags & OFN_ALLOWMULTISELECT ) ? 5128 : 256 );

Please increase it (double or triple) and try it again, thanks :-)
Taavi
 
Posts: 89
Joined: Mon Nov 21, 2005 10:29 am

Re: Problem with aGetFiles()

Postby Daniel Garcia-Gil » Wed Oct 13, 2010 12:27 am

Taavi

please change this value too


Code: Select all  Expand view
ofn.nMaxFile        = ( dwFlags & OFN_ALLOWMULTISELECT ) ? 15384 : 256;
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Problem with aGetFiles()

Postby Taavi » Wed Oct 13, 2010 9:34 am

Thanks, it worked now.

shouldnt't we also change number here?

if ( dwFlags & OFN_ALLOWMULTISELECT ) hb_retclen( pFile, 5128 );


Daniel Garcia-Gil wrote:Taavi

please change this value too


Code: Select all  Expand view
ofn.nMaxFile        = ( dwFlags & OFN_ALLOWMULTISELECT ) ? 15384 : 256;
Taavi
 
Posts: 89
Joined: Mon Nov 21, 2005 10:29 am

Re: Problem with aGetFiles()

Postby James Bott » Wed Oct 13, 2010 2:58 pm

I suggest that the value 5128 could be made into a manifest constant so it only has to be changed in one place in the future.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Problem with aGetFiles()

Postby Antonio Linares » Wed Oct 13, 2010 4:31 pm

James,

Fixed for next build using a define constant :-)
regards, saludos

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 81 guests