Quote:
Originally posted by Marco F
Sorry to tell you that (and I can't tell that this is fine), but:
1) I tried your code sniplet and it didn't work for me
2) I changed the names to the german translations and it worked ...
PDH_STATUS pdhResult = 0;
TCHAR szCounterPath[1024];
DWORD dwPathSize = 1024;
PDH_COUNTER_PATH_ELEMENTS pe;
HQUERY hQuery;
HQUERY hCounter;
pdhResult = PdhOpenQuery( NULL, 0, &hQuery );
pe.szMachineName = 0l;
pe.szObjectName = "Prozessor";
pe.szInstanceName = "_Total";
pe.szParentInstance = NULL;
pe.dwInstanceIndex = 0;
pe.szCounterName = "Prozessorzeit (%)";
pdhResult = PdhMakeCounterPath(&pe, szCounterPath, &dwPathSize, 0);
pdhResult = PdhAddCounter(hQuery, szCounterPath, 0, &hCounter);
So you have to try the russian equivalents (sorry, or is there a difference between russian and white-russian / belaruss ? Im not sure, I should know that living here not to far away from you, but I have to admit I don't) and I think you have to use unicode for that.
That is why on my previous posts I kept asking for him to run perfmon and look at the counter name.