|
Joined: Feb 2004
Posts: 2,019
Hoopy frood
|
OP
Hoopy frood
Joined: Feb 2004
Posts: 2,019 |
It is very unfortunate, that $comcall is far from stable in the current mIRC version. I really wish this was fixed, because I could make great things, but they often rely on $comcall, which at this point is almost useless for me. Try this code, but beware it _will_ freeze your mIRC, forcing you to close it with ctrl-alt-del. alias comcallbug {
.comopen ie internetexplorer.application
!.echo -q $com(ie,visible,2)
echo -a Visible?: $com(ie).result
echo -a Now using comcall to do the same
!.echo -q $comcall(ie,myalias,visible,2)
}
[color:red] [/color]
alias myalias {
echo -a Visible?: $com($1).result
.comclose ie
}
Gone.
|
|
|
|
Joined: Feb 2004
Posts: 2,019
Hoopy frood
|
OP
Hoopy frood
Joined: Feb 2004
Posts: 2,019 |
And here's another bug with comcall: Here the code works fine, it will popup a message box saying "no bug": alias code_without_comcall {
if ($istok(95 98,$os,32)) return
var %mss = mss $+ $ticks, %t
.comopen %mss MSScriptControl.ScriptControl
%t = $com(%mss,language,4,bstr*,vbscript)
%t = $com(%mss,executestatement,1,bstr*,msgbox "no bug")
.comclose %mss
} Here the code doesn't work at all, whilst there's no reason for it not to: alias code_with_comcall {
if ($istok(95 98,$os,32)) return
if ($com($1)) {
echo -a at comcall
.comclose $1
}
else {
var %mss = mss $+ $ticks, %t
.comopen %mss MSScriptControl.ScriptControl
%t = $com(%mss,language,4,bstr*,vbscript)
%t = $comcall(%mss,code_with_comcall,executestatement,1,bstr*,msgbox "bug")
}
} I can't remember one time where $comcall isn't bugged in some way, please Khaled fix this, it's such a pity we can't use this to its full extent.
Gone.
|
|
|
|
Joined: Feb 2004
Posts: 2,019
Hoopy frood
|
OP
Hoopy frood
Joined: Feb 2004
Posts: 2,019 |
And here's yet another occasion where comcall doesn't work as it should:
With either of these progids:
; winhttp.winhttprequest ; winhttp.winhttprequest.5.1 ; msxml2.serverxmlhttp ; microsoft.xmlhttp
After calling the open method, doing a $comcall(<object>,<alias>,send,1) results in the immediate calling of the <alias> instead of waiting for the send call to return.
Gone.
|
|
|
|
Joined: Sep 2005
Posts: 2,881
Hoopy frood
|
Hoopy frood
Joined: Sep 2005
Posts: 2,881 |
More bugs: 1) This will make the 'mIRC has encountered a problem and needs to close...' dialog open. alias a {
.comopen a WMPlayer.OCX
; The following line is the cause of the crash.
if ($com(a)) .comclose a $comcall(a,b,Settings,3,unknown* b)
}
alias b {
if ($com(b)) {
echo -a $(,,$com(b,autoStart,3)) $com(b).result
.comclose b
}
} /a 2) Is it just me or does $comcall & dispatch/unknown not work well together at all? I can't get them to work together but I can get them to work with $com. alias a {
.comopen a WMPlayer.OCX
if ($com(a)) .echo -q $comcall(a,b,Settings,3,unknown* b)
}
alias b {
.comclose a
echo -a $(,,$com(b,autoStart,3)) $com(b).result
.comclose b
} /a
|
|
|
|
|