Category does not exist?

  • Thread starter Thread starter yxq
  • Start date Start date
Y

yxq

System.InvalidOperationException: Category does not exist.
at System.Diagnostics.PerformanceCounterLib.CounterExists(String machine,
String category, String counter)
at System.Diagnostics.PerformanceCounter.Initialize()
at System.Diagnostics.PerformanceCounter.NextSample()
at System.Diagnostics.PerformanceCounter.NextValue()
at ProcessManager.frmMain.Timer2_Tick(Object sender, EventArgs e)
at System.Windows.Forms.Timer.OnTick(EventArgs e)
at System.Windows.Forms.Timer.Callback(IntPtr hWnd, Int32 msg, IntPtr
idEvent, IntPtr dwTime)

*********************************************
How to slove this problem?
Thank you
 
Supply some code to do with Timer 2 on frmMain, which will help matters
somewhat.

Why don't you convert your Handle (Hwnd) to integer, idEvent to integer &
dwTime to either integer or double?

Again, we need your code to help you

Crouchie1998
BA (HONS) MCP MCSE
Official Microsoft Beta Tester
 
Thank you, my code:
****************************************
For Each eachProcess As Process In Process.GetProcesses()
arrPro(0) = eachProcess.MainModule.ModuleName
....
Next
****************************************
 
yxq said:
For Each eachProcess As Process In Process.GetProcesses()
arrPro(0) = eachProcess.MainModule.ModuleName

'Process' is based on performance counters, if they are disabled or you
don't have rights to access them using 'Process.GetProcesses' will fail. In
Windows 2003 you will have to add the user to a certain group in order to be
able to access performance counters:

<URL:http://groups.google.de/[email protected]>
 
Back
Top