2009-08-28 25 views
0

1つのボタンと1つのテキストボックスでフォームアプリケーションを作成し、このエラーを再現できるかどうかを確認しました。Windowsクラス名が正しくありません - VS 2008/C#

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

エラーは、それが悪いに関連している可能性がBOLD

答えて

0

にライン上で起こる:コンパイルとF5で実行しようとしたら、私はこれが私のメインである、このエラーに

 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) 

を得続けますcomctl32.dllまたは同様のDLLのバージョン。ここでTreeViewコントロールを中心と議論がある:のVisual Studio 2005で古いプロジェクトで作業をしながら、私の記憶を検索するビットが、これはとは何かを持っていることを覚えておくことは十分にジョギングした後ちょうどこのに遭遇し

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

+0

だけ掲示リンクは悪いフォームと見なされます。私はそれを少し編集します、あなたがそれを好きでない場合はロールバックします。 –

0

Visual Studioをホストしているプロセスを修正し、次のようにして修正しました。 - ビルド - >クリーンソリューション - Visual Studioを終了し、エクスプローラを開いて、使用している構成のbinディレクトリに移動します。デバッグ設定の場合は、\ bin \ Debugに移動します)。 - そこには、特にホスティングプロセスの実行可能ファイル(.vshost.exe)がいくつか残っている必要があります。このファイルを削除し、ホスティングプロセスの実行可能ファイルに関連付けられた.configファイルと.manifestファイルを安全にしてください。 - Visual Studioを再起動し、ソリューションを再度ビルドします。

ソリューションをクリーンアップせずに実行可能なホスティングプロセスを削除するだけで解決できる場合があります。また、プロジェクトのプロパティの[デバッグ設定]に移動し、[Visual Studioのホスティングプロセスを有効にする]チェックボックスをオフにして、実行可能ファイルを削除することもできます。ただし、ホスティングプロセスではデバッグバージョンの読み込み速度が向上します。可能であれば、再度有効にしてください。

(編集)これを再訪した後、別の解決策が見つかりました。 Application.Run()への呼び出しの前に、main()関数に次の行を追加します

Application.EnableVisualStyles(); 
関連する問題