44203Re: [libertybasic] Re: veneffy - program causes exception error
- Jan 1, 2012Stefan,
It was the MaxPath size. When I had searched on the MSDN site, the only
thing I found was a mention of 256 bytes. I see now that _MAX_PATH = 260
even though it doesn't seem to be allowed in the AS char[...] length.
Thanks a lot for your efforts!
> Am 01.01.2012 18:16, schrieb veneff@...:
>> Actually, the question I should have been asking, is the C type bool 16
>> 32 bits.
> The LB boolean is 16-bit long and BOOL is 32-bit, so the API function
> likes to return more than boolean can hold and you get an overflow error.
> The general protection violation is usually indicating the use of an
> incorrect data type:
> 1) one that can't hold the returned value
> 2) using a regular data type, where a structure containing that data
> type should be used to enable the API function to fill it with a
> 3) using a string pointer without a trailing CHR$(0) initially
>> Anyway, I think your function FindFiles seems to working. I did get an
>> error keyNotFound (or something like that) one time, but I may have done
>> something to cause it by ending the LB task prematurely because it was
>> taking so long to run because the file list string was growing large
>> iterating that loop 1000 times. I'm going to restructure the original
>> program so that the find first...next API calls occur together in the
>> routine. This will take some time but I'll let you know what I find.
>> Why do you figure the problem was occurring?
> It might have been the file name item of the structure, which is
> declared as char[MAX_PATH] in C, where MAX_PATH is 260 instead of 256 as
> you used.
> Stefan Pendl
> LB 4.04 Pro ... http://www.libertybasic.com/assist.html
> LB 4.04 ....... http://www.libertybasic.com/lb404setup.exe
> LB Community Wiki .............. http://basic.wikispaces.com/
> LB Programmer's Encyclopedia ... http://lbpe.wikispaces.com/
> LB Bug Tracker ................. http://libertybasicbugs.wikispaces.com/
> Books at http://www.lulu.com/ and http://www.amazon.com/
> Alyce Watson ... APIs for Liberty BASIC
> Carl Gundel .... Beginning Programming with Liberty BASIC
> Windows 7 Home Premium 64-bit SP1
> AMD Turion X2 RM-70 2GHz, 4GB RAM
> Yahoo! Groups Links
- << Previous post in topic Next post in topic >>