?
Solved

'System.NullReferenceException'  error

Posted on 2006-11-05
4
Medium Priority
?
196 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month9 days, 21 hours left to enroll

762 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