mIRC Homepage

DLL Returning more than 900 chars, workaround?

Posted By: DogFood

DLL Returning more than 900 chars, workaround? - 30/10/03 05:17 PM

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?
Posted By: Narusegawa_Naru

Re: DLL Returning more than 900 chars, workaround? - 30/10/03 06:15 PM

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).
Posted By: DogFood

Re: DLL Returning more than 900 chars, workaround? - 30/10/03 07:21 PM

Problem is the function returns multiple filenames and relative paths
Posted By: Narusegawa_Naru

Re: DLL Returning more than 900 chars, workaround? - 30/10/03 07:55 PM

then most likely youll want to take advantage of the mapped file ability and call an alias or signal passing in each filename found.
Posted By: TheXenocide

Re: DLL Returning more than 900 chars, workaround? - 31/10/03 04:45 PM

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.
Posted By: tontito

Re: DLL Returning more than 900 chars, workaround? - 03/11/03 08:25 PM

try to put it in a binvar
© 2021 mIRC Discussion Forums