My problem now is that $dll is not multi-threaded. $dllcall is. I'm not sure how it works, but I think it can't return a value, but just start a process/thread. It would be nice if I could use $dllcall and that would return the CRC-string but I don't think that would work. Another soloution if $dllcall can't return data is to make the dll put the results in a txt-file and let mIRC read the file when the $dllcall is finished. However, I do not know how to do this.
Here is my mIRC-script:
alias crcsjekk {
set %tal.sfv.fp $sfile(C:\, SVF File, Check)
set %tal.sfv.f $nopath(%tal.sfv.fp)
set %tal.sfv.p $nofile(%tal.sfv.fp)
set %tal.sfv.lines $lines(%tal.sfv.fp)
var %hits.not.found = 0
var %hits.valid = 0
var %hits.not.valid = 0
var %total.files = 0
var %a = 1
set %tal.crc.msg Checking %tal.sfv.f
window -a @tal.CRC 0 0 640 480
if ($exists(%tal.sfv.fp) == $true) {
while (%a <= %tal.sfv.lines) {
if ( $left($read(%tal.sfv.fp, n, %a),1) != $chr(59) ) {
inc %total.files
if (%tal.crc.msg != $null) { aline 13 @tal.CRC %tal.crc.msg | unset %tal.crc.msg }
if ($exists(%tal.sfv.p $+ $gettok($read(%tal.sfv.fp, %a), 1, 32)) == $false) {
aline 7 @tal.CRC NOT FOUND - $gettok($read(%tal.sfv.fp, %a), 1, 32) | inc %hits.not.found
}
;;;;;;;; if ($crc(%tal.sfv.p $+ $gettok($read(%tal.sfv.fp, %a), 1, 32), 2) == $gettok($read(%tal.sfv.fp, %a), 2, 32)) {
if ($dll(crc.dll, crc, %tal.sfv.p $+ $gettok($read(%tal.sfv.fp, %a), 1, 32)) == $gettok($read(%tal.sfv.fp, %a), 2, 32)) {
aline 3 @tal.CRC VALID - $gettok($read(%tal.sfv.fp, %a), 1, 32) | inc %hits.valid
}
else {
aline 4 @tal.CRC NOT VALID - $gettok($read(%tal.sfv.fp, %a), 1, 32) | inc %hits.not.valid
}
}
inc %a
}
aline 13 @tal.CRC Total files: %total.files Valid: %hits.valid Not valid: %hits.not.found Not found: %hits.not.found
}
else {
aline 11 @tal.CRC %tal.sfv.fp not found
}
}
**EDIT**
This may help someone understand some more. Perhaps this will help rewriting the DLL?
<QUOTE>
The DLL can return an integer to indicate what it wants mIRC to do:
0 means that mIRC should /halt processing
1 means that mIRC should continue processing
2 means that it has filled the data variable with a command which it wants mIRC to perform, and has filled parms with the parameters to use, if any, when performing the command.
3 means that the DLL has filled the data variable with the result that $dll() as an identifier should return.
</QUOTE>
Last edited by arex; 31/08/04 02:25 PM.