Windows Develop Bookmark and Share   
 index > Windows Forms General > null reference exception in Form.get_IsMdiChild()
 

null reference exception in Form.get_IsMdiChild()

Hello

A customer of ours is having a problem running our software which we cannot reproduce on our machines. Application.Run() fails. The stack trace is

System.NullReferenceException: Object reference not set to an instance of an object.
at System.Windows.Forms.Form.get_IsMdiChild()
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Control.set_Visible(Boolean value)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at MapStar.Program.Main()

Does anyone have any ideas on what the problem could be?

Thanks
Dominic
Dom31  Wednesday, September 02, 2009 11:04 AM
Send them a custom build with thorough logging, so you'd be able to pinpoint more closely where the exception is thrown.
http://blog.voidnish.com
Nishant Sivakumar  Wednesday, September 02, 2009 2:01 PM
Thanks for the reply.

I don't understand what other logging I can do - the stack trace shows that the exception is thrown in Form.get_IsMdiChild(). How can I pinpoint it any more than that?
Dom31  Friday, September 04, 2009 8:51 AM

Hi,

I think you need to check which action invokes form.get_IsMdichild() method. Seems the form is not initialized or has been set to nothing or disposed before been used.

Best regards,

Ling Wang


Please remember to click “Mark as Answer�on the post that helps you, and to click “Unmark as Answer�if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Ling Wang  Wednesday, September 09, 2009 9:31 AM

We are changing the issue type to “General Discussion�because you have not followed up with the necessary information. If you have more time to look at the issue and provide more information, please feel free to change the issue type back to “Question�by opening the Options list at the top of the post window, and changing the type. If the issue is resolved, we will appreciate it if you can share the solution so that the answer can be found and used by other community members having similar questions.


Please remember to click “Mark as Answer�on the post that helps you, and to click “Unmark as Answer�if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Ling Wang  Sunday, September 13, 2009 9:06 AM

You can use google to search for other answers

Custom Search

More Threads

• Input from a Barcode Scanner
• Problem to update the db and read COM port
• Text Wrapping in WebBrowser control
• how to number pages (1 of 5, 2 of 5, etc etc) with the PrintDocument object
• ListBox.Remove
• textbox multiple selected text
• How to display "Please wait, while your request being processed" message
• How to Deploy windows application?
• When Form.Load() will be called...?
• Borders.