|
TreeView intensively use an Hashtable of node where only insertion and none removal ops are perform.
Could you explains how cleaning is handle?
1) Does this involves that despite of manually removing, Treenode always remains in memory during execution?
2) or is it due to (TreeNode)collection processing whom release dead node.
How does this works anyway? how null value are detected?
waiting for your help, thanxs cause a lot now
|
|
|
|
|
It’s due to Elnino! ... No Seriously,
What you are probably seeing is the .NET garbage collector at work (or sleep, as it where), plus possibly the node (bucket?) caching mechanism in the internals of the TreeView itself. I haven’t bothered to drill down in enough detail to see if they are reusing their internal data structures of the later, but it’s a pretty fair assumption.
BTW, if you are holding on to a reference to a removed tree node to see if it goes away, it won’t happen...
Cheers
|
|
|
|
|
just use ildasm: the (assembly) hastable is nodeTable. grep it in TreeNode* + TreeView, you'll found two Op is performed:
create (powerful),
adding in TreeNode.Realize: treeView.nodeTable[htreeitem] = this;
several reasons:
* The paradigm it's to inherits from TreeNode but pb is that data aren't released .
* Notice that original removal is slowest enough without inheritance
if time must increase sic.
* What i mean it 's not caching but smth like MapHandle % MapPermanentHandle in MFC. Imagine if nodeTable grow without freeing anytime you use it.
--
I like my program not to be potentially more corrupted after 30 mn tht 3mn, you know. What can be done ?
|
|
|
|
|
Interesting, I’ll take a look when I find a spare minute...
|
|
|
|
|
I am trying to test some web services that are freely available on the internet (translators, weather, etc) using my Windows Forms client application. Problem is that I can't access any remote wsdl service description, I always get a message 'HTTP Status 407 - Proxy access denied'. Description for that message is that I don't have right authentication. I am supposedly cleared of any proxy interference on my side, is this a client side or a server side (proxy) message? At the same time all those services work fine when I access them using IE. I am probably missing something in the whole picture.
Any suggestions?
Regards,
Dejan Petrovic
|
|
|
|
|
HTTP status 407 is a server message.
I am willing to try to access services from my computer. Can you give me a web service IP?
-Gile
|
|
|
|
|
Why does my C# app ask for some key in the registry that has to do with the .NET framework!?!?!?!
It can't be true that all persons that want to use my Visual C# app have to install the whole .NET framework!!?!?
Rickard Andersson@Suza Computing
ICQ#: 50302279 (Add me!)
E-mail: nikado@pc.nu
I'm from the winter country SWEDEN!
|
|
|
|
|
well, your customers need to to install the .net runtime which is about 20M. Without it your app will not work. Hopefully, within the next couple of months, years, the .net runtime will be installed by default. (I hope)
|
|
|
|
|
Rickard Andersson wrote:
It can't be true that all persons that want to use my Visual C# app have to install the whole .NET framework!!?!?
Not the whole framework. But they'll need the .NET redistributable installed. Just like you need the JRE to run that J thing
Nish
The posting stats are now in PDF:-
http://www.busterboy.org/codeproject/
Feel free to make your comments.
Updated - May 04th, Saturday
|
|
|
|
|
Nish [BusterBoy] wrote:
Just like you need the JRE to run that J thing
I think Nish was making some comment about that coffee flavored language....someone go tell him that talk like that isn't allowed here[Kidding ]
Nick Parker
|
|
|
|
|
Nick Parker wrote:
I think Nish was making some comment about that coffee flavored language....someone go tell him that talk like that isn't allowed here
ROTFLMAO Nick
The posting stats are now in PDF:-
http://www.busterboy.org/codeproject/
Feel free to make your comments.
Updated - May 04th, Saturday
|
|
|
|
|
Where to find that!!!!!!
Rickard Andersson@Suza Computing
ICQ#: 50302279 (Add me!)
E-mail: nikado@pc.nu
I'm from the winter country SWEDEN!
|
|
|
|
|
try here
http://www.msdn.microsoft.com/downloads/default.asp
then go to sw development kits/ms .net framework redistributable. you can get it from there. Also, I have heard that the .net redistibutable is available from Windows Update. I haven't seen this myself, maybe because I already have it on my machine but it's supposed to be there.
|
|
|
|
|
http://download.microsoft.com/download/.netframesdk/Redist/1.0/W98NT42KMeXP/EN-US/dotnetredist.exe
Nish
The posting stats are now in PDF:-
http://www.busterboy.org/codeproject/
Feel free to make your comments.
Updated - May 04th, Saturday
|
|
|
|
|
This code gives me the exception (don't remember exactly): "The instance object cannot be null"
Do you know whats wrong?? I don't think you'll need more code than this, because this is my exception!!
FileInfo fileInfo = new FileInfo(files[i]);
StreamReader streamReader = fileInfo.OpenText();
// Hela raden
string line;
do
{
line = streamReader.ReadLine();
// Does line contain "searchText"??
if(line.IndexOf(searchText) != -1)
{
listBox1.Items.Add(line);
}
}
while(line != null);
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
You need to check for line = null; before you look for the word. You put the check in at the bottom of the loop, but not before you use it
[Edit] If the idea of checking your break condition twice makes you uneasy you can do this
while(true)
{
line = streamReader.ReadLine();
if(line == null)
break;
....
} [/Edit]
James
Simplicity Rules!
|
|
|
|
|
Why not
while(line = streamReader.ReadLine())
{
}
???
Does C# not support that either ?
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
Christian Graus wrote:
Why not
while(line = streamReader.ReadLine()){
???
You should be able to do this as long as you check
if(line == null)
break;
before doing any string manipulation. You can't manipulate a Null value.
Nick Parker
|
|
|
|
|
In C++, the whole point of
while(line = streamReader.ReadLine()){
is that it would break when line became Null. You're telling me this is another area that C# falls short of C++ ?
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
C# way is to do
while((line = streamReader.ReadLine()) != null)
{ }
much clean.
|
|
|
|
|
I thought that might be the case. It's NOT much cleaner, it simply follows the C# philosophy of making the programmer explicitly state their intentions, of assuming the programmer is an idiot.
However, at least it can be done in a similar manner. Thanks for the tip.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
|
streamReader.ReadLine() will return a null if the stream is at end. So, change the if to:
FileInfo fileInfo = new FileInfo(files[i]);
StreamReader streamReader = fileInfo.OpenText();
string line;
do
{
line = streamReader.ReadLine();
<font color="red">if ((line != null) && (line.IndexOf(searchText) != -1))</font>
{
listBox1.Items.Add(line);
}
}
while(line != null);
Crivo
Automated Credit Assessment
|
|
|
|
|
Thank you!
But now when I try to make the strings upper I get this exception:
"Object reference not set to an instance of an object"
I sound to me that the upperLine and upperSearchText are not constructed or something like that1!?!??!??
Here is the code:
FileInfo fileInfo = new FileInfo(files[i]);
StreamReader streamReader = fileInfo.OpenText();
// Hela raden
string line;
do
{
// Läs nu in rad för rad
line = streamReader.ReadLine();
string upperLine = line.ToUpper();
string upperSearchText = searchText.ToUpper();
// Testa och se om "searchText" finns innuti raden
if (line != null)
{
int ret = upperLine.IndexOf(upperSearchText);
if(ret != -1)
{
listBox1.Items.Add(line);
}
}
}
while(line != null);
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
You still are trying to access line after ReadLine() and before cheking it for null.
Crivo
Automated Credit Assessment
|
|
|
|