mIRC Home    About    Download    Register    News    Help

Print Thread
#221294 13/05/10 09:13 PM
Joined: Apr 2010
Posts: 964
F
Hoopy frood
OP Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 964
I'm trying to mkae a System stats dialog, but have ran into a snag. When I got to update the CPU And Ram Load's it freezes mIRC until the data is returned. I'd like to use $comcall so the query gets threaded but all I get so far is $comerr in the callback alias.

All I really need is an example of how to get Win32_Processor.DeviceID.LoadPercentage and Win32_OperatingSystem.FreePhysicalMemory with $comcall

Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
Direct from the help file:
Quote:
$comcall() uses the same format as $com() apart from the alias. It is multi-threaded so it will not halt the script and will call the specified alias once the call returns.

Note: If $comcall() fails when calling an object and $com() does not, this means that the object is not compatible with the threading model of mIRC, so $com() must be used. You can check the $comerr value in the alias to determine if a $comcall() failed or not.


So, if you're using the same format and it's failing, it probably can't be done. That or your format needs work. Can you paste what you're trying to use?

Joined: Apr 2010
Posts: 964
F
Hoopy frood
OP Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 964

Not really sure exactly how comcall works. What I'm currently doing is have an alias like so:
Code:
alias update SysStatsDialog {
  ;locator and services are opened when dialog opens so no need to open them again

  noop $com(SR.SS.Services, Get, 3, String, SELECT LoadPercentage FROM Win32_Process Where DeviceID = "CPU0",dispatch* SR.SS.CPU)
  if ($com(SR.SS.CPU)) {
    /changedialogIDto: $comval(SR.SS.CPU, 1, LoadPercentage)
  }
}

as the $comval() retrieves the info, mIRC freezes. I'd like to use $comcall instead with a callback, so mIRC wouldn't freeze :\


Link Copied to Clipboard