Autor Beitrag
VT
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 25



BeitragVerfasst: Mo 11.08.03 01:01 
Hi Leute,

hab mal wieder Probleme beim Coden. Und zwar will ich die PDH Api auslesen. Ich erstell also ne Query und füge dann mit PDHAddCounter z.b. System Uptime hinzu. Dann sammle ich die Daten ein, mit PdhCollectQueryData. Danach kommt mein Problem. Kann mir mal bitte jemand erklären wie ich die Werte jetzt umrechne die die Funktion PdhGetFormattedCounterValue zurückgibt ??? Ich checks nun nach 5 stunden msdn lesen nich...

Hier mein Codestück was ich bis jetzt hab:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
PdhBrowseCountersA(@x);
PdhOpenQuery(nil,0,qhandle);
PdhAddCounterA(qhandle,pchar(@p[0]),0,chandle);
PdhCollectQueryData(qhandle);
PdhGetFormattedCounterValue(chandle,PDH_FMT_LONG,@ctype,@cval);

ctype gibt nun PERF_ELAPSED_TIME an. Laut msdn soll ich das mit (Y-X)/TB umrechnen. Naja vieleicht hat sowas ja schon jemand gemacht und kann mir helfen *hoff*

Moderiert von user profile iconTino: Leere Absätze entfernt.
VT Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 25



BeitragVerfasst: Di 12.08.03 15:11 
ok, hat sich erledigt. ich hab mit delphi alles mögliche probiert. hab mir jetzt mit c++ ne dll geschrieben die die benötigten pdh funktionen exportiert, das bind ich dann in delphi ein und schon gehts, obwohl ich in c++ genau das selbe stehen habe...