Win32Excpetion was unhandled

  • Thread starter Thread starter Brian
  • Start date Start date
B

Brian

I have a simple windows application and sometimes when I go to run, I get
the this error
and it says "Window class name is not valid."
What does this mean, and why does it only sometimes do this. not very
considant. My class name is
Public Class frmMain
 
I have a simple windows application and sometimes when I go to run, I get
the this error
and it says "Window class name is not valid."
What does this mean, and why does it only sometimes do this. not very
considant. My class name is
Public Class frmMain

It seems "Public Class frmMain" refers to your form. Make sure your
form's name is "frmMain". See form's properties window to check the
correct name.
 
It seems "Public Class frmMain" refers to your form. Make sure your
form's name is "frmMain". See form's properties window to check the
correct name.

Additionaly, however there's a thread on:
http://forums.microsoft.com/msdn/sh...13&siteid=1&sb=0&d=1&at=7&ft=11&tf=0&pageid=2

and it's said that this can be fixed by doing the following:
From the start up project, click Properties, select the Debug pane,
and uncheck "Enable the Visual Studio hosting process".

Hope this helps.
 
the form name is frmMain.vb.
Its weird, because there is no pattern to it. Sometimes the app runs no
problem, others it causes this error, and when the the error does happen, i
stop and restart a few times and then it runs?
Brian
 
the form name is frmMain.vb.
Its weird, because there is no pattern to it. Sometimes the app runs no
problem, others it causes this error, and when the the error does happen, i
stop and restart a few times and then it runs?
Brian

OK, then try this trick which may help you as stated in my previous
post:

From the start up project, click Properties, select the Debug pane,
and uncheck "Enable the Visual Studio hosting process".

....mentioned on:
http://forums.microsoft.com/msdn/sh...13&siteid=1&sb=0&d=1&at=7&ft=11&tf=0&pageid=2

Hope this helps.
 
You need to get more details, such as the stack trace at the time to really
track this down. The Win32Exception tells you it is a native code
exception, not a managed code one. The Window class name is not valid refers
to a class name used by Windows, such a button or cmbbox etc, not your
code's class name. The class name might be a built in one (unlikely) or one
that is registered via a call to RegisterClass or RegisterClassEx.
 
Back
Top