By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,929 Members | 634 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,929 IT Pros & Developers. It's quick & easy.

What causes VB to throw an exception because of a new untouched Windows-Form?

P: 1
Visual Basic worked fine for a while, but now for no apparent reason it can't even handle a Windows-Form with no single line of code.
The Error:
Expand|Select|Wrap|Line Numbers
  1. System.InvalidOperationException wurde nicht behandelt.
  2.   Message=Fehler beim Erstellen des Formulars. Weitere Informationen finden Sie in Exception.InnerException. Fehler: External component has thrown an exception..
  3.   Source=WindowsApplication1
  4.   StackTrace:
  5.        at WindowsApplication1.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190
  6.        at WindowsApplication1.My.MyProject.MyForms.get_Form1()
  7.        at WindowsApplication1.My.MyApplication.OnCreateMainForm() in C:\Documents and Settings\Mormel\Local Settings\Application Data\Temporary Projects\WindowsApplication1\My Project\Application.Designer.vb:line 35
  8.        at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
  9.        at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
  10.        at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
  11.        at WindowsApplication1.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
  12.        at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
  13.        at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
  14.        at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
  15.        at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
  16.        at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
  17.        at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
  18.        at System.Threading.ThreadHelper.ThreadStart()
  19.   InnerException: System.Runtime.InteropServices.SEHException
  20.        Message=External component has thrown an exception.
  21.        Source=System.Drawing
  22.        ErrorCode=-2147467259
  23.        StackTrace:
  24.             at System.Drawing.SafeNativeMethods.Gdip.GdipCreateFontFromLogfontW(HandleRef hdc, Object lf, IntPtr& font)
  25.             at System.Drawing.Font.FromLogFont(Object lf, IntPtr hdc)
  26.             at System.Drawing.Font.FromHfont(IntPtr hfont)
  27.             at System.Drawing.SystemFonts.get_DefaultFont()
  28.             at System.Windows.Forms.Control.get_DefaultFont()
  29.             at System.Windows.Forms.Control.GetDefaultFontHandleWrapper()
  30.             at System.Windows.Forms.Control.get_FontHandle()
  31.             at System.Windows.Forms.ContainerControl.GetFontAutoScaleDimensions()
  32.             at System.Windows.Forms.ContainerControl.get_CurrentAutoScaleDimensions()
  33.             at System.Windows.Forms.ContainerControl.get_AutoScaleFactor()
  34.             at System.Windows.Forms.ContainerControl.PerformAutoScale(Boolean includedBounds, Boolean excludedBounds)
  35.             at System.Windows.Forms.ContainerControl.PerformNeededAutoScaleOnLayout()
  36.             at System.Windows.Forms.Form.OnLayout(LayoutEventArgs levent)
  37.             at System.Windows.Forms.Control.PerformLayout(LayoutEventArgs args)
  38.             at System.Windows.Forms.Control.System.Windows.Forms.Layout.IArrangedElement.PerformLayout(IArrangedElement affectedElement, String affectedProperty)
  39.             at System.Windows.Forms.ContainerControl.LayoutScalingNeeded()
  40.             at System.Windows.Forms.ContainerControl.set_AutoScaleMode(AutoScaleMode value)
  41.             at WindowsApplication1.Form1.InitializeComponent() in C:\Documents and Settings\Mormel\Local Settings\Application Data\Temporary Projects\WindowsApplication1\Form1.Designer.vb:line 26
  42.             at WindowsApplication1.Form1..ctor()
  43.        InnerException: 
  44.  
Dec 10 '10 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.