自分はDXライブラリを用いてこんな基礎プログラムを書きました。
//Main.cpp
#include "DxLib.h"
#include "GV.h"
#include "CheckKey.h"
extern void CheckKeyAll();
int ProcessLoop(){
if(ProcessMessage() < 0){
return -1;
}
if(SetDrawScreen(DX_SCREEN_BACK) == -1){
return -1;
}
CheckKeyAll();
return 0;
}
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow){
ChangeWindowMode(TRUE);
SetGraphMode(300,500,32);
if(DxLib_Init < 0){
MessageBox(NULL,_T("DXライブラリの初期化に失敗"),_T("Error"),MB_OK);
return -1;
}
while(ProcessLoop() != 0){
if(CheckStateKey(KEY_INPUT_ESCAPE) != 0){
break;
}
ScreenFlip();
}
DxLib_End();
return 0;
}
//CheckKey.cpp
#include "DxLib.h"
int stateKey[256];
void CheckKeyAll(){
char key[256];
GetHitKeyStateAll(key);
for(int i = 0;i < 256;i++){
if(key[i] == 1) stateKey[i]++;
else stateKey[i] = 0;
}
}
int CheckStateKey(unsigned char Handle){
return stateKey[Handle];
}
そしてこのプログラムをデバッグしたときに、なぜかウィンドウが表示されませんでした。ブレークポイントを用いて確認しましたが、ちゃんとwhileの中までちゃんと実行されています。
コンパイル、リンクエラーもおきませんでした。
実行ログはこちらです。
'DestroyBlock.exe': 'C:\Documents and Settings\ken-dai\My Documents\Visual Studio 2010\Projects\DestroyBlock\Debug\DestroyBlock.exe' を読み込みました。シンボルが読み込まれました。
'DestroyBlock.exe': 'C:\WINDOWS\system32\ntdll.dll' を読み込みました。Cannot find or open the PDB file
'DestroyBlock.exe': 'C:\WINDOWS\system32\kernel32.dll' を読み込みました。Cannot find or open the PDB file
'DestroyBlock.exe': 'C:\WINDOWS\system32\user32.dll' を読み込みました。Cannot find or open the PDB file
'DestroyBlock.exe': 'C:\WINDOWS\system32\gdi32.dll' を読み込みました。Cannot find or open the PDB file
'DestroyBlock.exe': 'C:\WINDOWS\system32\shell32.dll' を読み込みました。Cannot find or open the PDB file
'DestroyBlock.exe': 'C:\WINDOWS\system32\advapi32.dll' を読み込みました。Cannot find or open the PDB file
'DestroyBlock.exe': 'C:\WINDOWS\system32\rpcrt4.dll' を読み込みました。Cannot find or open the PDB file
'DestroyBlock.exe': 'C:\WINDOWS\system32\secur32.dll' を読み込みました。Cannot find or open the PDB file
'DestroyBlock.exe': 'C:\WINDOWS\system32\msvcrt.dll' を読み込みました。Cannot find or open the PDB file
'DestroyBlock.exe': 'C:\WINDOWS\system32\shlwapi.dll' を読み込みました。Cannot find or open the PDB file
'DestroyBlock.exe': 'C:\WINDOWS\system32\imm32.dll' を読み込みました。Cannot find or open the PDB file
'DestroyBlock.exe': 'C:\WINDOWS\system32\lpk.dll' を読み込みました。Cannot find or open the PDB file
'DestroyBlock.exe': 'C:\WINDOWS\system32\usp10.dll' を読み込みました。Cannot find or open the PDB file
'DestroyBlock.exe': 'C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.6028_x-ww_61e65202\comctl32.dll' を読み込みました。Cannot find or open the PDB file
'DestroyBlock.exe': 'C:\WINDOWS\system32\comctl32.dll' を読み込みました。Cannot find or open the PDB file
プログラム '[2524] DestroyBlock.exe: ネイティブ' はコード 0 (0x0) で終了しました。
なにが原因と考えられるか、教えてください。お願いします。