|
Hi,
I think this is the issue that is causing trouble...but i don't find any other way barring recursion which can easily navigate into the inner classes...The dll's in fact contain many number of innerclasses and properties... so is there any solution for this??
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
|
|
|
|
|
Spunky Coder wrote: I think this is the issue that is causing trouble...
I very much doubt that....
Spunky Coder wrote: The dll's in fact contain many number of innerclasses and properties...
I have several times used a class in a class, perhaps sometime a class in a class in a class. I could imagine a reason to do perhaps four or five levels, but hardly more than that. Do you say that the assembly contains classes that are nested inside each other to something like hundred levels?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
There is probably something going wrong in the recursion as the nesting should not really get that deep. When the exception occurs take a second to look at the stack trace in the debugger and get an idea of how deep the recursion got. However, to answer your question the alternate of recursion is to use and manage a Stack yourself. Using the Generic Collections from .NET 2.0, you can use Stack<T> for this purpose. It's really the same concept as recursion because in recursion you're using the call stack and the system is managing it for you. Anyhow, there are bunches of good articles on the internet of how to mimic recursion with a stack; off-hand I found this one:
http://haacked.com/archive/2007/03/04/Replacing_Recursion_With_a_Stack.aspx[^]
Hope that helps!
Keep It Simple Stupid! (KISS)
|
|
|
|
|
Hi,
Thanks for the reply...I have gone through the article but seems that it doesn't work if there are any circular references. But in the dll's i use, circular reference exist. So is this kind of situation can be solved ??
Also is it a good thing to increase the stack size ??
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
|
|
|
|
|
Spunky Coder wrote: But in the dll's i use, circular reference exist.
Class definitions can not be circular. A class can not be defined inside itself...
Spunky Coder wrote: Also is it a good thing to increase the stack size ?
You have something around a megabyte of stack space, what you are doing should typically use something like 0.1% of that. If you run out of stack space, it's not the size of the stack that is the problem.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
I generally follow this pattern to prevent circular references. Create a List<t></t> that will accompany your stack. This will contain the items that have already been processed. At the top of your stack loop, the first step is to pull the next item of the stack and the second step should be to check that item against the list of items already processed. If it has already been processed, discard it and go to the next item. I generally put this in place even when the data SHOULDN'T have circular references, but I prefer to be safe rather than deal with some difficult to find bug later on.
Hope in one hand and poop in the other; see which fills up first. Hope and change were good slogans, now show us more than words.
|
|
|
|
|
|
Tuntgerhuu wrote: Help me
We all are with you. Go on, friend.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
I've created WCF application, from WCF client application i'm calling service application (basically Windows Service) methods but i'm not able to receive service response there.
If I call from multi thread environment then I'm getting response, what should be done for NON-Multi threading call?
Thanks
|
|
|
|
|
I can use String.IsNullorEmpty() to test a string for null. How can I test a string for DBnull please?
|
|
|
|
|
Hi,
you can use
<br />
if(myValue != DBNull.Value) {<br />
...<br />
<br />
}<br />
for the check if the value equals the value DBNull.
Regards
Sebastian
|
|
|
|
|
Just an addition, if you are using a DataReader you can call the method
<br />
DataReader myDataReader = null;<br />
...<br />
if(myDataReader.IsDBNull(...)) {<br />
...<br />
}<br />
|
|
|
|
|
Hi,
This is from Chandrakanth.
My question is How to Convert Data from Tiff file to Text Format.
Actually we are using OCR(Third Party Tool) for this conversion. But we
don't want to use that Third party tool. We do want get the data with
out using OCR. Is there any other way to get the Data from Tiff File to
Text Format.
Actually i am looking for some souce code.
Can any one give me reply for this
Thanks and Regards
Chandrakanth
|
|
|
|
|
Hi,
as far as I know is a Tiff File an Image file. That means that the bytes within the file just contains information about which color has the pixel at position x and y. The data itself doesn't know anything about if it is text or the picture of something.
So if you really don't want to use a third party tool, "all" you have to do is to write yourself an OCR application.
Regards
Sebastian
|
|
|
|
|
Hello ! I'm new to C# and I've found in one sample from Codeproject something like this:
string temp=@"temp string blah blah";
What does that @ before string ?
Thanks
|
|
|
|
|
It means verbatim string literal[^], so special characters don't need to be escaped.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Wow, that was fast
Thanks, I understand now
|
|
|
|
|
If I accidentally click on a GUI element or a form in the VS Editor, it produces event code for that element, even if I don't want to handle that event. Then if I deleted that code I get an error. It's annoying and it clutters up my code.
Is there a way to get rid of this code, or somewhere I shold move it?
Thanks
James
|
|
|
|
|
In the IDE go to the properties window, change to events view, right click the offending event and RESET.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thanks for your help Mycroft, and excuse my human stupidity.
James
modified on Thursday, January 22, 2009 5:55 AM
|
|
|
|
|
Not a problem, I only recently found that when it turns out C#/VS2008 does not automatically remove it from the designer file
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Yeah, that's a pain, but it was easily discovered in the error list when a compile is attempted, right?
I considered the original message to be a stupid question given the relative simplicity of the answer (all he had to do was double-click the error and it would have taken him to the offending code in the designer).
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hello,
I want to add a new menu item in winXP Explorer context menu (right click menu).
For example, I right click in winXP Explorer, and the "newCommand" option is shown.
Can this be done via C#?
Thanks!
|
|
|
|
|
Plenty of examples around clickety[^]
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
can any one help me how to implement global.aspx in c#.net.If any one knows give me the detail steps !!
|
|
|
|