Hi.

--- In [email protected], "theyaleon" <[EMAIL PROTECTED]> wrote:
> so output was:    ðÒÏÃÅÓÓÏÒ(0)\% ÚÁÇÒÕÖÅÎÎÏÓÔÉ ÐÒÏÃÅÓÓÏÒÁ

I suppose it reads differently in russian, but you must use it 
exactly as it's outputted. And you need to escape the "\"s.

> and I've put it into other Mockey' script

The script was intended for two CPUs.
Try this simplified one:

local err, counterPath, counterVal, hCounter, hQuery, str
counterPath = ?"\ðÒÏÃÅÓÓÏÒ(0)\% ÚÁÇÒÕÖÅÎÎÏÓÔÉ ÐÒÏÃÅÓÓÏÒÁ"
counterVal = dll.create_struct("ui[2] i")
err = dll.call("pdh.dll|PdhOpenQuery|s! ui ui*", "", 0, "hQuery")
err = dll.call("pdh.dll|PdhAddCounterA|ui s ui ui*", hQuery,;;+
 counterPath, 0, "hCounter")
for (local i = 1; i <= 3; i++)
str = "processor load: "
err = dll.call("pdh.dll|PdhCollectQueryData|ui", hQuery)
err = dll.call("pdh.dll|PdhGetFormattedCounterValue|ui ui ui t*",;;+
 hCounter, 0x100, 0, counterVal)
str ++= counterVal[3] ++ "%"
win.debug(str)
wait.for(1000)
endfor
err = dll.call("pdh.dll|PdhCloseQuery|ui", hQuery)

> but I've got errors:
> ERROR: dll.create_struct: Wrong number of parameters
>          counterVal = dll.create_struct("ui[2] i")
> dll.dll v.0.81

This error is probably caused by old dll-version.
Get the current one (1.03).

Mockey



Reply via email to