|
Well, not really. I know how performance counters work, how to create them, etc. etc. My question is how to I get a performance counter, in say the .NET GC category, for the "current", that beeing the key word, process. The process that I'm actually instantiating the performance counter from? This is not a web application, its a windows forms application. I'm not trying to recreate the perfmon application, I don't want to view performance counters for "other" processes....I want to view them for the process from which I instantiate the counter.
I've looked and looked, but there doesn't seem to be a site on the net or a single word in the .NET documentation that says how to get a counter for the current app, the one that instantiates the performance counter itself. The current instance is what I'm inclined to call it, but there doesn't seem to BE a current instance, only global instances and specific instances for some apps.
|
|
|
|
|
I'm considering migrating to Visual C# and expanding my skills. But is it worth it considering many of the things I need to do can be done using Managed C++. Also in MC++ it is possible to continue to use the STL.
What can be done in C# that can't be in MC++, are their any distinct advantages, apart from nicer syntax and more companies seem to want c# programmers than MC++?
Or is it best to create an appliction using C# and then use MC++ to create components that use the STL and other C++ only features? What i'm really getting at, is it worth gettin Visual C# instead of continuing to use Managed C++ in Visual C++ .Net 2003?
Thanks for your time.
P.S. If anyone knows of a company in the UK requiring or desiring a recent graduate with a 2:1 in Computing, please let me know
|
|
|
|
|
There are a few things I miss from C++ (like templates, const functions/parameters) when I migrated to C#, but there are a number of things that I like about C# (like not having to worry so much about forgetting delete and the resulting memory leaks)
From a marketing perspective (i.e. Marketing your skills to prospecive employers) C# is on the increase and would definitely be an advantage.
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
Enumerators in .NET: See how to customise foreach loops with C#
|
|
|
|
|
if you use managed objects in c++ though, you still don't have to remember to use delete, as it's handled by the Garbage Collector. Though skills wise it is probably worth it.
|
|
|
|
|
A well renound hecker remarked "C# is C+-". And according to my experience he is very true. The way U can write blazing fast,flexible code in C++, is a distant dream in C#. Professionaly, development time in C# is less, because of boiler plate codes,hence it is in demand. But it still has to go a long way to reach the penetration what C++ enjoys.
Cheers!!
Siddharth
|
|
|
|
|
Depends on the amount of the complexity of programs and the amount of knoweledge you have.
Here is a little picture:
Knowledge to do Visual Basic (6) CSharp (Or Java) C++
Simple work Very Few Some Lots
Medium work Lots Lots Lots
Complex work Forget it Very Much Lots
Chooses depending on the amount of time you want to invest, or the kind of application you will build up.
|
|
|
|
|
I'm trying to provide simple "pop-up" (e.g., tooltip-style) help hints for my dialog controls (standard Windows Forms using C#), using System.Windows.Forms.HelpProvider and System.Windows.Forms.Form.HelpButton. I'm using only the "SetHelpString()" method on the HelpProvider to set the help text to strings managed internally by the application.
When I invoke the help the first time, it always seems to work. Sufficient subsequent invocations invariably either crash the program completely (with an "Application Error" dialog:
The instruction at "xxxxx" referenced memory at "xxxxx".
The memory could not be "written". Click on OK to terminate
the program
- sometimes it says "read" instead of "written") or cause some very strange application error/exception that the CLR does manage to catch.
Does anyone recognize this? Is there a fix for it? I've searched MSDN Knowledge Base and Google (and here at CodeProject) for clues, but nothing comes up.
Help!!
Here's a program that demonstrates this problem for me, usually within 5-10 usages of the "HelpButton":
-----------------------
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace WindowsApplication1
{
///
/// Summary description for Form1.
///
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.HelpProvider helpProvider1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.TextBox textBox1;
///
/// Required designer variable.
///
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
string s= "This is the help for button 1 I hope it is long and helps us to figure out where the problem is" ;
helpProvider1.SetHelpString(button1, s) ;
s= "This is the help for button 2 I hope it is long and helps us to figure out where the problem is" ;
helpProvider1.SetHelpString(button2, s) ;
s= "And this help is for the text box" ;
helpProvider1.SetHelpString(textBox1, s) ;
}
///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.helpProvider1 = new System.Windows.Forms.HelpProvider();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// button1
//
this.button1.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.button1.Location = new System.Drawing.Point(184, 16);
this.button1.Name = "button1";
this.button1.TabIndex = 1;
this.button1.Text = "Cancel";
//
// button2
//
this.button2.Location = new System.Drawing.Point(184, 56);
this.button2.Name = "button2";
this.button2.TabIndex = 2;
this.button2.Text = "button2";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(24, 24);
this.textBox1.Name = "textBox1";
this.textBox1.TabIndex = 3;
this.textBox1.Text = "textBox1";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(288, 122);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.textBox1,
this.button2,
this.button1});
this.HelpButton = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
}
#endregion
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
}
}
|
|
|
|
|
Your problem is not with the code attached. At least I do not get the error after 35 tries (.NET 1.1.4322)
|
|
|
|
|
Thanks for checking that out!
In "Help:About" from my "Visual C# .NET" IDE, I see I'm using "Microsoft .NET Framework Version 1.0.3705" (e.g., a very old version). It would appear to be a bug that has been fixed in updates to the .NET framework and/or the IDE.
Do you know where I can get the update(s) for my .NET Framework and IDE? I've tried the "Check for Updates" menu item (it fails without giving a reason), and looked around Microsoft's Support website for updates, but am not sure what I need.
|
|
|
|
|
i can't seem to find any audio stream related classes in the documentation.
thanks.
|
|
|
|
|
Look int he directX documenttatioan...
/\ |_ E X E GG
|
|
|
|
|
if i use directx classes in my app, will that force users to install directx separately? i am hoping to avoid that.
|
|
|
|
|
Have you looked into using the DirectX Managed SDK?
|
|
|
|
|
Hello,
I want to change the default setting for the option:
1) Just me
2) every one
in select installation folder and set the every one as default option,
but I don't know how should I do it.
Besides according to this option I want to set some data in different
keys in registry I do not how can I get the user selected optionin the
dialog and then use it for setting registry data ?
Thanks in advance,
Saeideh
|
|
|
|
|
um, you have to learn a language called 'orca'... i think that's what it's called.
It will let you make more advanced installers. Search the C# forum for stuff on that...
and also, check out InstallShield. I beleve you can do it in that.
/\ |_ E X E GG
|
|
|
|
|
Thank you for your reply, I could solve my problem by Orca ...
Regards,
Saedeih
|
|
|
|
|
Hello All,
We need help for a technical issue that we are facing in our application
(TA-RES) developed using .NET technology. The details of the issue are as
follows.
Steps for reproducing this problem:
1. Open 2 browser instances
2. In one instance start a product search
3. While the product search is on in the first window, perform a search or
request another page in the same application
It is observed that the execution of the second request starts only when
the processing of the first request is completed. We confirmed this by putting
log statements in the web pages. As per the time stamps the second request
is processed when the first request is completed. From the logs it is also
observed that when the first request is being executed, the init of the
second page is also not called indicating that the requests are being
executed serially by IIS.
When a test application was tried with the same server and configuration
files, we did not notice this behavior. Has anybody come across this
problem? Any help in resolving this issue will be appreciated.
The application has been developed using .NET 1.0 Framework. Please let us
know if you need any more information.
Take what you most fervently believe, what you most longingly hope for, what you most sincerely value, and put those things into practice. That's the way to truly make them real.
|
|
|
|
|
I don't know if this might help as I've never researched it but I've noticed that if a number of browser windows are open on a client and I try and make many connections to the same web site the requests appear to get sent almost in sequence (it seems to allow 2 or 3 concurrent requests at most [with each graphic counting as a request also]). Could this be it?
As I've said it is not something I've researched but just something I've observed.
Do you get the same results if the two client browsers are on different machines?
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
Enumerators in .NET: See how to customise foreach loops with C#
|
|
|
|
|
Colin Angus Mackay wrote:
it seems to allow 2 or 3 concurrent requests at most
It's something done at an HTTP level - it is regarded as good form to only make a small number of simultaneous HTTP connections to a web server, and 2 is a common value here. Some web servers also limit the number of simultaneous connections.
--
Ian Darling
"The moral of the story is that with a contrived example, you can prove anything." - Joel Spolsky
|
|
|
|
|
The problem is not just with 2 instances but also with 2 users accessing the same site.
To isolate the problem we are putting up an application onto that server. This currently is working fine on another box and we will monitor the behaviour on the box where the problem is being noticed.
Any inputs will be appreciated.
Thanks
|
|
|
|
|
the http standard define a max two connects per client (http://www.faqs.org/rfcs/rfc2068.html[^] - 8.1.4 Practical Considerations).
However I suspect your problem might be unrelated to this.
Have you looked at the CPU usage during execution of the request? you might find that your system is busy handling one request and not switching to complete the new request.
Also your request may be blocking due to a request to a single handle resource - are you using a file or db - what is the locking mechanism...
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
Make sure you turn off session state for any pages that don't need it, otherwise requests from the same session will be serialized:
...the session state module implements a reader/writer locking mechanism and queues the access to state values. A page that has session-state write access will hold a writer lock on the session until the request terminates.
A page claims write access to the session state by setting the EnableSessionState attribute on the @Page directive to true. (This is the default setting.) A page, though, can also have read-only permissions on the session state, for example, when the EnableSessionState attribute is set to ReadOnly. In this case, the module will hold a reader lock on the session until the request for that page finishes. As a result, concurrent readings can occur.
If a page request sets a reader lock, other concurrently processed requests in the same session cannot update the session state but are at least allowed to read. This means that when a session read-only request is being served, awaiting read-only requests are given higher priority than requests needing a full access. If a page request sets a writer lock on the session state, all other pages are blocked, regardless of whether they have to read or write. For example, if two frames attempt to write to Session, one of them has to wait until the other finishes.
http://msdn.microsoft.com/library/en-us/dnaspp/html/aspnetsessionstate.asp[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
Can someone help me understand why HttpWebRequest doesn't return the same thing as IE with some sites?
I'm writing an app to rip some of Microsoft's online help pages. The URL I have works fine in IE or Mozilla, but when I try it with an HttpWebRequest it doesn't come back quite right.
<br />
http:
Please help me!!!
|
|
|
|
|
I have figured it out. I downloaded a Firebird extension that allows you to view the headers. After that, I just copied every single header value in the successful GET request into my program and it worked. I finally narrowed it down to the following header values that are required.
Accept-Language: en-us,en (of course, this is region specific)
User-Agent: (This can be set to whatever you want. I started with the standard "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705)". After I got it working I changed it to "Bob's browser" and it still worked. Therefore, it's required, but doesn't need a specific value.)
|
|
|
|
|
We just started writing our Windows Apps in C# instead of VC++. We do a lot of string parsing and was shocked to see that the .NET String classes don't appear to have Find, Mid, Left, Right etc... How can you disect strings without those functions? Thanks
|
|
|
|