|
perlmunger wrote:
I had a resource leak problem once where I wasn't freeing my resources soon enough.
That sounds about right. ALLWAYS kleen up your mess
MyDUMeter: a .NET DUMeter clone
|
|
|
|
|
Being a C++ programmer I understand where you're coming from. I'm a C++ programmer as well. However, this is not C++, and it's not a leak. I can't easily post the code.
First of all, this is managed code. This is further proven by the fact that if I switch to a smaller list after the problem has happened, I can continue to run.
Second, it's not like it's happening due to repeated operations. I can run all day, so long as I don't have too many controls up at one time. The first time I graph 100 at a time I fail, but I can choose 20 different lists of 10 in sequence and I still work fine so long as I don't do it too fast (so the GC has time to catch up).
What it appears to be is that I'm limited to 16384 window handles. if each control has a window handle, that means 2 per bar (one for the bar, which is a UserControl, and one for the ToolTip window I assume), 108 bars per graph, Around 12 extra for scales and such on the graph, that's 24,000 window handles. This is almost certainly the problem. I changed it so that instead of a full-out control, each bar is defined by a helper class that renders it and the problem went away (obviously the helper class doesn't use a window handle, it just has the paint code). My question is, can I get around the 16K limitation (if that is indeed the limit)?
|
|
|
|
|
jpwkeeper wrote:
that means 2 per bar (one for the bar, which is a UserControl, and one for the ToolTip window I assume), 108 bars per graph, Around 12 extra for scales and such on the graph, that's 24,000 window handles.
You mean all the "bars" are seperate controls? GDI is a must! I dont even wanna know how much memory this thing eats!
MyDUMeter: a .NET DUMeter clone
|
|
|
|
|
O yes, have a look at my MyDUMeter article. I do some "graphing" in there. Have a look at the ReportForm. Might be of some help.
MyDUMeter: a .NET DUMeter clone
|
|
|
|
|
Anyone looked at accessing a CORBA Orb from C# or from another .NET language.
Thanks,
Giles
|
|
|
|
|
hi!
how can i do that near of my TreeNode in TreeView to be a '+' if in subdodes of these nodes was nothing until exand it.
i want to fill node when expanding..
thx
|
|
|
|
|
subscribe for the OnBeforeExpand event.
|
|
|
|
|
I use a process in which I first only load the first three "generations" of the treeview. Then in the BeforeExpand event, I populate that node's grandchildren. Therefore, any time the user sees a node, it always shows its expand icon (the [+]) if it has children.
Jim Stewart
|
|
|
|
|
I am about to start writing some components in .net that will need to interact with an LDAP directory (Not MS Active Directory!)
Can any one send me any pointers?
Thanks
|
|
|
|
|
System.DirectoryServices should work with any LDAP server.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
The following code loads the contents of a web page (Page) into string PageText:
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(new Uri(Page, true));<br />
request.Method = "GET";<br />
<br />
HttpWebResponse response = (HttpWebResponse) request.GetResponse();<br />
Stream responseStream = response.GetResponseStream();<br />
StreamReader reader = new StreamReader(responseStream);<br />
string PageText = reader.ReadToEnd();
The problem I have is that the page I receive comes back with encoding that doesn't show up correctly in a text box. For example a single quote ’ comes back as & # 8 2 1 7 ; (without the spaces). I think that this would be correctly displayed in a HTML viewer, but how do I get it to display correctly in a text box?
Putting an encoding in the constructor for the StreamReader seems to make no difference.
Thanks in advance,
Keith
|
|
|
|
|
Would the System.Web.HttpUtility.HtmlDecode() method work?
|
|
|
|
|
This is a C# application and not ASP.NET code or a WebService. Therefore I don't have access to the System.Web namespace. Sorry, I should have mentioned this first time.
Thanks for the response.
Keith
|
|
|
|
|
Did you tried System.Net.WebClient?
<br />
using System.Text;<br />
using System.Net;<br />
<br />
...<br />
<br />
WebClient request = new WebClient();<br />
string PageText = Encoding.Default.GetString(request.DownloadData(Page));<br />
Cheers,
John
|
|
|
|
|
I've tried this but the result is exactly the same regardless of the encoding.
|
|
|
|
|
What happens if you use:
<br />
...<br />
string pagetext = Encoding.ASCII.GetString(request.DownloadData(Page));<br />
...<br />
Sorry if you already have tried it...
|
|
|
|
|
I tried Encoding.<everything I could think of>.GetString all to no avail.
Actually .ASCII makes things slightly worse!
|
|
|
|
|
It seems that you're getting an unicode encoded page from the web server. Did you tried Encoding.Convert?
<br />
using System.Text;<br />
...<br />
string pagetext = Encoding.Default.GetString(Encoding.Convert(Encoding.Unicode, Encoding.ASCII, request.DownloadData(Page)));<br />
...<br />
What language is your web page/web server? You may try to change Encoding.Unicode to other encoding like UTF8, and Encoding.ASCII to UTF8 if you're still getting wrong results. I'm using the default encoding to read web pages in english/portuguese, and the results are ok for me.
Cheers,
John
|
|
|
|
|
i bound a reference into my program but when i try to start it, an unhandled exception occures: "Object reference not set to an instance of an object"
how can i resolve this?
thanks
John
|
|
|
|
|
Anonymous wrote:
i bound a reference into my program but when i try to start it, an unhandled exception occures: "Object reference not set to an instance of an object"
how can i resolve this?
You need to initialize your object within the application, try adding something like the following, possibly in InitializeComponent() .
this.YourObject1 = new YourObject();
Nick Parker
The only man who never makes a mistake is the man who never does anything. - Theodore Roosevelt
|
|
|
|
|
Hello NG,
I have a standard C# Class-library Project and want it to behave like the SQl-Connection User Control. Means you can drag it from the toolbox on a form and it docks underneath the forms designer.
Does anybody know how to achieve this?
Thanks in advance
Stefan
|
|
|
|
|
You should inherit "Component" not "Control"
//Roger
|
|
|
|
|
Thanks for the fast Answer Roger
|
|
|
|
|
How to Select a existing directory name by showing a dialog.
( like in .net environment : file->newproject->location )
|
|
|
|
|
Take a look at this [^] article written by Rama Krishna
Cheers,
John
|
|
|
|