473,395 Members | 1,987 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

SystemMonitor ActiveX control and custom performance counters


I have the SystemMonitor ActiveX control on a form and I try to register a custom performance counter.
I expect that after registering the counter with the OS, the user would be able to add it through
this System Monitor ActiveX control on the form.
Yet, the Add dialog of this ActiveX does NOT contain the already registered counter.
Does anyone know what might be wrong?
Code snippet follows at the end.
BTW if I have the code that registers the counter in a separate executable, then the ActiveX has my
counter. But if they're in one and the same executable, the ActiveX doesn't have it !?!

Ivan

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Diagnostics;

namespace WindowsApplication1
{
public class Form1 : System.Windows.Forms.Form
{
private AxSystemMonitor.AxSystemMonitor axSystemMonitor1;
private System.ComponentModel.Container components = null;

[STAThread]
static void Main()
{
CounterCreationDataCollection CCDC = new CounterCreationDataCollection();
CounterCreationData ccd = new CounterCreationData(
"MyCounterName",
"Some Help",
PerformanceCounterType.NumberOfItems32
);
CCDC.Add( ccd );
if (PerformanceCounterCategory.Exists("MyCategoryName ") )
PerformanceCounterCategory.Delete("MyCategoryName" );
PerformanceCounterCategory.Create("MyCategoryName" , "Some Help", CCDC);

Application.Run(new Form1());
}

public Form1()
{
InitializeComponent();
}

protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

#region Windows Form Designer generated code
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
this.axSystemMonitor1 = new AxSystemMonitor.AxSystemMonitor();
((System.ComponentModel.ISupportInitialize)(this.a xSystemMonitor1)).BeginInit();
this.SuspendLayout();
this.axSystemMonitor1.Enabled = true;
this.axSystemMonitor1.Location = new System.Drawing.Point(0, 0);
this.axSystemMonitor1.Name = "axSystemMonitor1";
this.axSystemMonitor1.OcxState =
((System.Windows.Forms.AxHost.State)(resources.Get Object("axSystemMonitor1.OcxState")));
this.axSystemMonitor1.Size = new System.Drawing.Size(328, 272);
this.axSystemMonitor1.TabIndex = 0;
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(344, 269);
this.Controls.Add(this.axSystemMonitor1);
this.Name = "Form1";
this.Text = "Form1";
((System.ComponentModel.ISupportInitialize)(this.a xSystemMonitor1)).EndInit();
this.ResumeLayout(false);

}
#endregion
}
}
Nov 17 '05 #1
0 2698

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: David Mitchell | last post by:
Hello group, I'm trying to write code to test an application we're developing. This application needs to store its own performance data in the registry, and we'd like to be storing quite a...
1
by: W1ld0ne74 | last post by:
I am implimenting Performance counters into a web application. I use the following code to create the counters during setup: private void SetupPerfCntrs() {...
0
by: Christopher Attard | last post by:
Hi, I need to create a dialog like the 'Add Counters' dialog box in perfmon. I'm using the System.Diagnostics namespace class in .NET and I've managed to do it. The problem arises when I'm...
0
by: Daniel Melo | last post by:
I have been looking for the solution of this problem for several months and I could not solve. I will try to post something again : Facts : a) I have a custom web control derived from...
7
by: James | last post by:
Hi Has anybody had any experience of ASP.Net performance counters not updating. In the performance monitor application when I try to add the groups ASP.NET and ASP.NET Applications the...
3
by: Weston Fryatt | last post by:
Simple question I hope.... How do I send data to and from an ASP.Net (server side) web page to a ActiveX Control (client side) embedded in a web browser??? What I need to do, is I have image...
6
by: Budhi Saputra Prasetya | last post by:
Hi All, I'm trying to display .NET Custom Control (created using Inherited Control) on an ASPX page, but no luck. I already registered the Control to Global Assembly Cache through .NET Framework...
1
by: kret | last post by:
Hi, this is my first post so first of all I would like to say hello :) Now getting to my problem. In my job I have to create an ActiveX control in .NET 1.1 that can be lunched from IE....
0
vekipeki
by: vekipeki | last post by:
Does anyone know if there is a way to set a custom mouse cursor for an ActiveX control in .Net? I am adding some mouse functionality to an existing ActiveX control, and would like to change the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.