mIRC Home    About    Download    Register    News    Help

Print Thread
DLL Returning more than 900 chars, workaround? #58456 30/10/03 05:17 PM
Joined: Sep 2003
Posts: 3
D
DogFood Offline OP
Self-satisified door
OP Offline
Self-satisified door
D
Joined: Sep 2003
Posts: 3
Hi, im working on a file searching script, and it returns full paths to mirc, thus using more than what mirc allows, is there a way to work around this problem?

function gets called and returns:
a:\kjfh,jfhljd\fdjkfdg\77493847\file.txt
b:\kjfh,jfhljd\fdjkfdg\77493847\file.mrc
c:\kjfh,jfhljd\fdjkfdg\77493847\file.fdf
d:\kjfh,jfhljd\fdjkfdg\77493847 \file.doc
e:\kjfh,jfhljd\fdjkfdg\77493847 \file.nfo

Any Ideas?

Re: DLL Returning more than 900 chars, workaround? #58457 30/10/03 06:15 PM
Joined: Jun 2003
Posts: 195
N
Narusegawa_Naru Offline
Vogon poet
Offline
Vogon poet
N
Joined: Jun 2003
Posts: 195
filenames are limited to the constant MAX_PATH wich is 256. 900 is way more than that. for individual files this should be enough. if your trying to fill the data variable with multiple files i would recomend against it. alternatively you can use a custom alias or signal wich is called once for each file. this allows you to send multiple files with just one call and still remain under 900. you cannot alter the data variables size (realloc wont work because mirc expects it to be 900 so it wont use anything above that. also the pointer returned from realloc is not garaunteed to be the same altho there is a workaround for that).


Have Fun smile
Re: DLL Returning more than 900 chars, workaround? #58458 30/10/03 07:21 PM
Joined: Sep 2003
Posts: 3
D
DogFood Offline OP
Self-satisified door
OP Offline
Self-satisified door
D
Joined: Sep 2003
Posts: 3
Problem is the function returns multiple filenames and relative paths

Re: DLL Returning more than 900 chars, workaround? #58459 30/10/03 07:55 PM
Joined: Jun 2003
Posts: 195
N
Narusegawa_Naru Offline
Vogon poet
Offline
Vogon poet
N
Joined: Jun 2003
Posts: 195
then most likely youll want to take advantage of the mapped file ability and call an alias or signal passing in each filename found.


Have Fun smile
Re: DLL Returning more than 900 chars, workaround? #58460 31/10/03 04:45 PM
Joined: Oct 2003
Posts: 38
T
TheXenocide Offline
Ameglian cow
Offline
Ameglian cow
T
Joined: Oct 2003
Posts: 38
also, if you REALLY want to pass all the files in the returned value, you might try replacing text in the files with identifiers such as $mircdir. you can use SendMessage with file mapping (look up SendMessage in mIRCs helpfile if you are unsure of what i mean) to evaluate identifiers suck as $mircdir. This would only apply if the files are within mIRCs dir though. also using the short filename as opposed to the long filename will aslo save you some length. even so you should still use custom signals rather than this method because there is no gaurantee that this list will be less than 900 chars.


-TheXenocide
ParseMPopup
Re: DLL Returning more than 900 chars, workaround? #58461 03/11/03 08:25 PM
Joined: Feb 2003
Posts: 307
T
tontito Offline
Fjord artisan
Offline
Fjord artisan
T
Joined: Feb 2003
Posts: 307
try to put it in a binvar