Adnan
asked on
Getting Exception saying that Object refrence is not set to instance of an Object....
Hi
i am getting this exception when i came to this line in code below... tabManRecon.Controls.Add(u cReconManu ally);
can any one see what the problem is?
i am getting this exception when i came to this line in code below... tabManRecon.Controls.Add(u
can any one see what the problem is?
ReconManually ucReconManually;
private void ShowReconManually()
{
if (ucReconManually == null)
{
ucReconManually = new ReconManually(myOper);
tabManRecon.Controls.Add(ucReconManually);
ucReconManually.Dock = DockStyle.Fill;
ReconManualTabMenu = ((IMenu)ucReconManually).TabMenu();
}
ucReconManually.Show();
}
most likely the tabManRecon is not instantiated. Where is it declared? If you put a breakpoint there, is it null?
> is it null?
i mean: you can see that by hovering over it with your mouse or by typing it in in the Immediate window
i mean: you can see that by hovering over it with your mouse or by typing it in in the Immediate window
ASKER
sorry the real exceotion message is error creating window handeling????
that sounds more like the exception that comes after the previous. Can you place a breakpoint on that line or do you get another exception before that breakpoint? If you receive the exception, can you post the stacktrace here?
This error (cannot create window handle) can be raised as a result of too many (child) windows, or objects that are out of scope but not Disposed and are leaking memory or simply never release there handles. Here's one post on the subject: http://stackoverflow.com/questions/222649/winforms-issue-error-creating-window-handle
This one is on Dispose (a good read and if you never used Dispose before, i recommend reading it) http://blogs.msdn.com/jfoscoding/articles/450835.aspx
This one is on Dispose (a good read and if you never used Dispose before, i recommend reading it) http://blogs.msdn.com/jfoscoding/articles/450835.aspx
ASKER
if i set brakpoint on this li9ne "Â tabManRecon.Controls.Add(u cReconManu ally);", i do not get exception, i set breakpoint on the line and run my app, when it stop on the brakpoint i clikcked F5 and i dident get the exception....i can see mye form...????
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
thanks...
you're welcome ;)
-- Abel --
-- Abel --