The Windows class name is not a valid error - VS 2008 / C #

advertisements

I created a form application with 1 button and 1 text box to see if i could recreate this error and i did. Upon compiling and trying to run with F5 i keep getting this error

     at System.Windows.Forms.NativeWindow.WindowClass.RegisterClass()
   at System.Windows.Forms.NativeWindow.WindowClass.Create(String className, Int32 classStyle)
   at System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
   at System.Windows.Forms.Control.CreateHandle()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

This is my main:

static void Main()
    {
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);
        **Application.Run(new Form1());**
    }

Error happens on the line in BOLD


It could be related to a bad version of comctl32.dll or similar DLL. Here is a discussion centered around TreeView:

http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/e28e24cc-156c-433b-bc71-436384a3211d