Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

'System.NullReferenceException'  error

Posted on 2006-11-05
4
Medium Priority
?
198 Views
Last Modified: 2010-04-23
Hi folks,

   I am developing a vb.net application. I have rather a frustrating error that occurs and I can not seem to prevent or cure it. It does not matter what form I may executing etc - it has no pattern as to when it occurs.
Here is the error message:
"An unhandled exception of type 'System.NullReferenceException' occurred in system.windows.forms.dll
Additional information: Object reference not set to an instance of an object."

And it always takes me back to the main.vb form which contains this codiing. It always highlights the code line of:Application.Run(frmmdiparent)

Module main
    Public Sub Main()
        Dim frmmdiparent As New frmMainMenu
        'shows the splash screen
        Dim frmMainSplash As New frmMainSplash
        frmMainSplash.lblCopyright.Text = "Copyright" & "©2005 All Rights Reserved"          
        frmMainSplash.Show()
        Application.DoEvents()
        frmMainSplash.Hide()
        Application.Run(frmmdiparent)
    End Sub
End Module

any help appreciated -
0
Comment
Question by:bearpaws
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 19

Assisted Solution

by:VoteyDisciple
VoteyDisciple earned 400 total points
ID: 17876569
Yeah, I've noticed Visual Studio isn't too bright when it comes to debugging exceptions within threads.  One thing you might try is throwing a Try..Catch around code in frmmdiparent to at least narrow the error down to somewhere more specific so you at least won't be looking blindly anymroe.
0
 
LVL 34

Accepted Solution

by:
Sancler earned 1600 total points
ID: 17876588
An alternative approach to identifying the code that is actually causing the problem - less coding, although it doesn't always work - is (temporarily) to alter your project's properties so that frmMainMenu is its start form.

Roger
0
 

Author Comment

by:bearpaws
ID: 17876622
Good idea - I will try it and see what happens - I will return...
0
 

Author Comment

by:bearpaws
ID: 17876731
Another good idea! I will try that also!
more later and thanks you guys :-)
I am sure this can be resolved.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question