'System.NullReferenceException' error

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"          
    End Sub
End Module

any help appreciated -
Who is Participating?
SanclerConnect With a Mentor Commented:
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.

VoteyDiscipleConnect With a Mentor Commented:
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.
bearpawsAuthor Commented:
Good idea - I will try it and see what happens - I will return...
bearpawsAuthor Commented:
Another good idea! I will try that also!
more later and thanks you guys :-)
I am sure this can be resolved.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.