|
There are 3 open source C# compilers, why dont you look?
|
|
|
|
|
HI all,
i have created an MDI Application
i have created some threads in one of the forms
now when all the threads finish their processing
an exception is thrown by the application saying
"System.NullReferenceException
Object reference not set to an instance of an object"
and this exception is thrown by the main MDI form
i don't know what's going wrong where.
It will be great if some one could tell me the solution to this problem
Thanks,
Pramod
|
|
|
|
|
It would be usefull to post some code, run in debug and see where it happens.
At least check the Stack Trace in the exception and show the code from the method where it happens.
|
|
|
|
|
i have created all the threads on the click of a button
when the control returns after finishing all the threads
the exception is raised
Why is this exception raised?
is there anything to be done when the threads are finished with processing
and the control is returned from where they were spawned?
Thanks,
Pramod
|
|
|
|
|
There is as such nothing special you need to do with threads except be really really careful with race conditions and deadlocks.
XIUnin had some really good advise. The exception will tell you exactly where you use a null reference (or - if you do not do it yourself then where you call something else with bogus parameters resulting in that code using the null reference).
If you have problems following the advice then please indicate you do not know how to follow it (with detrails on why you get stuck and what you tried).
Also try to be more detailed. For example you write "when the control returns"... Well, threads do not return control. They keep running until terminated. So what do you mean? Do you call Join or what?
|
|
|
|
|
Hello,
Hope you all will be fine, I am developing a project in ASP.NET Is it possible to show only images or specific type of files in "HtmlInputFile" Dialog Box when user clicks on 'Browse' button in C# for Web Applications ????? If YES then HOW ??
Thanks and Best Regards,
AbuBakar Malik
|
|
|
|
|
|
hi..
i have some question ..
first one is i want to know when the class is loaded first time in c#?
is it at compile time or at run time? and how?
and where the memory is allocated to the class?
and when the memory allocated for static fields ? and how?
|
|
|
|
|
Hi
Every static variable is stored on the heap, regardless of whether it's declared within a reference type or a value type. There is only one slot in total no matter how many instances are created. (There don't need to be any instances created for that one slot to exist though.) Note that this heap is separate from the normal garbage collected heap - it's known as a "high frequency heap", and there's one per application domain.
For further reference please look this article
http://www.developerfusion.co.uk/show/4705/2/[^]
|
|
|
|
|
I am facing a situation where i need to change the border of a rich textbox ontrol from shrp corner to rounded rectangle. Can anyone help me to solve this problem in a easier way using C#.net 2005.
Is it needed to use GDI and painting to change the border to rounded rectangle.
Any replies will be great. thanks in advance.
Mukilan
|
|
|
|
|
I strongly doubt you can do this by modifying a RTB.
You could create a rounded rectangle Panel and place a regular RTB with BorderStyle=None on this Panel.
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
Thank you very much for your earliest reply. Even i thought of the same like changing the border of groupbox or using panel.
I will try it and inform you.
Regards
Mukilan.
|
|
|
|
|
Hi,
I am working in C# application that use one API(MessageBox) and LeadTools Ver 13.0.0.118.
At the time of closing the application, it gives System.NullReferenceException. I had tried by calling destructor and base class dispose method but this exception is still coming.How can I resolve this exception?
Thanks In Advance
Vikas Kohli
Vikas Kohli
|
|
|
|
|
Do you know which line of code and even more interesting which object causes this exception? If not, try to find out and afterwards explore where this object is previously set to null or why it wasn't initialized.
www.troschuetz.de
|
|
|
|
|
I want to show an arrow between the new inserted table and the last one that is already on word doc.
I am use a button to insert a new table on click of that button new table is inserted…
Anybody knows about that..
thanks
|
|
|
|
|
Hi,
I had a default role for a new member in my web.config file. Something with a value like "Member", but now I changed it to the corresponding ID (auto incrementing value):
<add key="DefaultRoleForNewMember" value="2"/>
I have a public method that goes and retrieves this value. When the value was still a string and not the 2, my function worked like this:
public static int DefaultRoleForNewMember
{
get
{
string strRole = WebConfigurationManager.AppSettings["DefaultRoleForNewMember"]);
if (string.IsNullOrEmpty(strRole))
throw (new NullReferenceException("DefaultRoleForNewUser configuration is missing from your web.config. It must contain <appSettings> <add key=\"DefaultRoleForNewUser\" value=\"Member\" /> </appSettings>"));
else
return (strRole);
}
}
Now that I have the value of 2, I will have to convert it to an int when getting the value for the web.config file. But now my confusion comes in where I throw an exception, like I had for if (string.IsNullOrEmpty(strRole))
I hope this is clear enough. Please let me know.
Regards,
ma se
|
|
|
|
|
I would do the conversion to an integer inside the else branch. If the conversion goes wrong you could throw another exception there telling that the DefaultRoleForNewUser exists but is invalid.
www.troschuetz.de
|
|
|
|
|
What exception must I try and catch?
|
|
|
|
|
|
sam_g1 wrote: I don’t know how to use the show the aero..
Could you explain as to what an AERO is?
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
hi
in the class library i am using filereaders,fileinfo,filestreams for reading and writing files for source and destination paths but i am getting error near the filereaders,filestreams "namespace or assembly missing" .Even if i use System.IO it still gives me an error.
Any solution for the above problem
sasi
|
|
|
|
|
Look at the error message, it will tell you exactly what class it has problems with. Then you look up the class in MSDN Library[^], there you will see what namespace the class is in.
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
I hope I'm not the only one hit by this: in some window forms I have a DataGridView having a DataSet (filled from a select) and AutoSizeColumnMode set to Fill. Before the form is showing up I get an unhandled exeption message with "This operation cannot be performed while an auto-filled column is being resized" - I have no clue about what operation we talking about and the exception is thrown randomly (and never if step through the application in debugger). If click Continue everything is OK, the form comes up filled, aligned and resized.
Somebody please give me a hint.
|
|
|
|
|
HI
how can add a object for example a line object to report in running mode ?
Regards Amir Jalaly
|
|
|
|
|
Hi,
I have a Win Form with a Main Menu, and I need to open one of these menu options via code.
I'm trying to password protect a menu. I've got it set up so that when a user selects a particular menu option, a Form pops up asking for a password. The trick is to open the menu without a select event happening (after the password is verified).
If you know of a better way to go about this, that would be great. I could have all the SubmenuItems Enabled=false by default and then change to true, but I think it would be better not to show the SubmenuItems at all.
Thanks,
Ron
|
|
|
|