0

私は、DevC++とVisualStudio2008の2つのIDEで、Forgerのwin32チュートリアルを実行しています。両方で結果を複製しようとしています。

チュートリアルのこのページでは Dev C ++でコンパイルできないようです(Visual Studioは正常に動作します)。モーダルダイアログボックスです。問題のコードは次のWndProcとおりです。

case ID_HELP_ABOUT:

  int ret = DialogBox(GetModuleHandle(NULL),
    MAKEINTRESOURCE(IDD_ABOUT),hwnd,AboutDlgProc);   //ERROR OCCURS HERE in Dev C++

  if(ret==IDOK) { MessageBox(NULL,"Dialog exited with OK","Notice",0); }
  else { MessageBox(NULL,"Dialog exited with EXIT","Notice",0); }

break;

スローされるエラーは次のとおりです。

Simple3\main.c In function `WndProc': 
Simple3\main.c syntax error before "int" 
Simple3\main.c `ret' undeclared (first use in this function) 

この時点より前に定義するint ret;とコンパイルされますが、通常のアプリと一緒にコマンドウィンドウが開きます。

ヘッダーがないのではないかと思います。私が使用しているヘッダーはとwindows.hですafxres.h。誰か助けてもらえますか?前もって感謝します。

PS-私がそれに取り組んでいる間、本当に簡単な質問-山かっこまたは引用符でヘッダーを宣言することの違いは何ですか?例<windows.h>または"windows.h"

4

1 に答える 1

0

Some compilers expect curly braces to be added between Case statement and break. Try using it.

I think it should work that way.

Besides regarding <> and "" for declaring headers, angular brackets indicate that the file will be searched in the default include directories mentioned with IDE. Whereas the "" are used when you want the file to be searched in the local project folder as well along with the include folder.

于 2010-10-28T00:26:34.013 に答える