473,587 Members | 2,505 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ComVisible object won't terminate if PerformanceCoun ter created internally

Hi all,

I'm hoping someone can help me with this bizarre problem. If I create a
new PerformanceCoun ter object in a ComVisible class and invoke it from
wscript, it never seems to terminate. When debugging, Visual Studio
never leaves the (running) state when the Go function exits (even
clicking the 'Stop Debugging' button fails). When not debugging, the
cscript / wscript.exe process never leaves memory.

I've tried this same code in a console app and a simple form based app
and they both terminate correctly. I've tried manually calling
counter.Close() but that didn't help either. Does anyone know what
causes this behaviour?

The only similar issue I was able to find can be found here:
http://www.dotnet247.com/247referenc...24/121316.aspx
I have all the latest framework service packs however so this doesn't
appear to be relevant.

using System.Diagnost ics;
using System.Runtime. InteropServices ;

namespace CounterTest
{
[ClassInterface( ClassInterfaceT ype.AutoDispatc h)]
[GuidAttribute(" 652B14C2-0221-4bff-A4AB-98DF2DB312E6")]
[ProgId("Counter Test.ThisWillHa ng")]
[ComVisible(true )]
public class ThisWillHang
{
public void Go()
{
PerformanceCoun ter counter = new
PerformanceCoun ter("Processor" , "% Processor Time", "_Total");
}
}
}

Aug 3 '06 #1
0 1229

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

Similar topics

28
20295
by: Daniel | last post by:
Hello =) I have an object which contains a method that should execute every x ms. I can use setInterval inside the object construct like this - self.setInterval('ObjectName.methodName()', this.pinginterval); - but is there no way to do this without using the literal ObjectName? If I write 'this.methodName()' I get "Line 1 Char 1: Object...
1
3289
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() { System.Diagnostics.CounterCreationDataCollection CounterDatas = null; System.Diagnostics.CounterCreationData cdCounter4 = null; try {...
1
7260
by: Chris | last post by:
I'm trying to do something really easy: just get the % CPU load. However, I just get mostly 0's sprinkled with an occasional 100. I poked around on the web for info, but all the stuff I found (I think) does what I have below. Am I blanking out on something here? Getting the available RAM works fine. Code example below: using System;
2
1696
by: R. Nachtsturm | last post by:
Hi, i have the problem that when i create a low priority background thread, start it, and wait for it to finish that it does not seem to terminate even after it is finished.. if i use performance monitoring to watch the actual thread count then it never goes down.. everytime i create a thread it goes up by one.. even if i abort the...
0
1028
by: ThisBytes5 | last post by:
We are developing a comvisible object that will be called from an asp page. This object in turn will load other .net assemblies, E.G. Entlib, other in house items, WSE3.0 imp, etc... Most if not all of the assemblies require settings in a configuration file. The issue is I am unsure of how to get my comvisible assembly and the others that...
3
4582
by: Geoff McElhanon | last post by:
I have been struggling with a security issue that occurs under .NET 2.0, but does not occur under .NET 1.1. Essentially I am trying to open up a performance counter on a remote server and monitor its value. In .NET 1.1 this worked fine, however under .NET 2.0 it fails when I am not an administrator on the remote server. To provide a lean...
3
7788
by: Adam Clauss | last post by:
I am working on modifying an existing library to expose portions through COM. Is it possible to return a generic object (say, List<string>) via this? So far I have not had much luck. When components call my method which returns a List<string(ex: javascript), the call succeeds, and SOMETHING comes back, but I cannot seem to locate any...
28
2113
by: ensemble | last post by:
I'm trying to utilized a more object-oriented approach to managing window events in javascript. Thus, I am creating a "controller" object to handle events and interact with the server. However, I apparently don't fully understand what "this" refers to. In the code below I was expecting that when the button was clicked...
11
5410
by: =?Utf-8?B?U2FsYW1FbGlhcw==?= | last post by:
Has anybody worked with performancecounter object to access counters on remote machine? I managed to write code that retrieves counters categories froma remote machine, when I try another remote machine I get "System.ComponentModel.Win32Exception" error. Error message is "The network path was not found." I have checked running services (RPC,...
0
7923
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
1
7974
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8221
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6629
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5719
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5395
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3882
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2364
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1455
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.