mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2008
Posts: 44
N
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Mar 2008
Posts: 44
Hi,
Suppose the data being passed back to mirc is more than the line limit (say 3000 odd to be safe) what's the usual method that is used for handling this ? - pass a switch back with the data returned to mirc -> then make my script in mirc check this switch in the return data, & make the script call the dll again in the case that there is more data to be fetched ? - I'd have to include a LoadDll() to keep the dll loaded for this i suppose.

Would appreciate any feedback or ideas.

Thanks
-

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Calling the dll multiple times is the easiest way. You can have your dll accept $dll(mydll.dll, GetData, N) where N is a positive integer from 1 to the number of "lines" it returns. You could then make N=0 return the number of lines as expected by convention.

Another way would be using SendMessage: /help SendMessage

There are existing code snippets to use SendMessage with mIRC (google). In this case you would want to send data to a callback alias, so your dll might take: /dll mydll.dll GetData callbackalias where callbackalias was defined as:

alias callbackalias { echo -a $1- }


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Mar 2008
Posts: 44
N
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Mar 2008
Posts: 44
Quote:
You can have your dll accept $dll(mydll.dll, GetData, N) where N is a positive integer from 1 to the number of "lines" it returns. You could then make N=0 return the number of lines as expected by convention.

not fully clear about that part , so after the first call to do the processing; say $dll(mydll.dll, Myproc, Data) i make another call to the GetData proc in my dll, $dll(mydll.dll, GetData, N) to check the number of lines, & possibly if there is more data.. withstanding ; then again call the dll with $dll(mydll.dll, Myproc, Data) to fetch the remaining data if neccessary & so on if there are more lines.

Picking up from your post,..I was thinking maybe, make the 1st byte of the return data hold the number of lines, that way it could be checked (by mirc) in the same call (let me know of possible downsides to this)

[Edit:] ..but maybe your method would possibly make for more flexibility & options that could come in use.

Many Thanks for all the info.
-

Last edited by Nightstorm; 20/05/09 02:26 PM.
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Yes. The first wall would cache the data and the subsequent calls to GetData would retrieve it. This is how things like $regml(N) work, so it should be a relatively natural API.

Callbacks are also relatively natural as they're used in commands like /play and /filter


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"

Link Copied to Clipboard