Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Visual Basic - Error I Can't Fix


  • Please log in to reply
2 replies to this topic

#1 Tbenner019

Tbenner019

  • Members
  • 12 posts
  • OFFLINE
  •  
  • Local time:07:37 PM

Posted 30 August 2007 - 04:28 PM

Hello everyone, I've been having trouble with an error I have no idea how to fix. The error is:

[codebox]System.InvalidOperationException was unhandled
Message="An error occurred creating the form. See Exception.InnerException for details. The error is: Object reference not set to an instance of an object."
Source="Practice1B"
StackTrace:
at Practice1B.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190
at Practice1B.My.MyProject.MyForms.get_Form1()
at Practice1B.My.MyApplication.OnCreateMainForm() in C:\Documents and Settings\User\Local Settings\Application Data\Temporary Projects\Practice1B\My Project\Application.Designer.vb:line 35
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at Practice1B.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
[/codebox]


It seems, from my understanding, that there is an error in the automatically generated code on LINE 81. I can't understand how to fix this problem and any help would be much appriciated.

Edited by Tbenner019, 30 August 2007 - 04:30 PM.


BC AdBot (Login to Remove)

 


m

#2 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:07:37 PM

Posted 30 August 2007 - 09:47 PM

The error message is simple enough.

Object reference not set to an instance of an object


Apparently you have not properly initialized a reference in line 190 of your code. Hard to say what is wrong without seeing the code though.

#3 TheDoctor

TheDoctor

  • Members
  • 6 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Parma, Italy
  • Local time:03:37 AM

Posted 12 September 2007 - 01:44 PM

I think the error is due to an attemp to modify the Auto-generated code of the form layout.
In Visual Basic .NET every forms create its own code for all the control in the form and the form layout too. These controls can be modified only with the integrated form editor. If someone tries to write his/her own form code from the "code editor" it will cause this kind of error.
You can try to remove the form that causes the error from your project, create a new one, remake the form controls and layout, then copy the source code from the old one to the new form and the problem should be fixed.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users