Problème Win32 en compilant sous VS 2005
Bonjour à tous,
J'ai un problème avec ce tutoriel ... [Voir CODE]
Sur mon ordinateur personnel ... avec VS 2005 Pro ... Projet Win32 vide. J'arrive parfaitement à exécuter ce programme ...
Cependant, à l'école avec Vs 2005 Pro (Aussi) Je n'y arrive pas ... (Mais une fenêtre normale fonctionne correctement)
Je veux seulement un dialogue comme fenêtre principale ...
Comment vais-je remettre mon travail ??
;)
Merci de bien vouloir m'aider.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
#include <windows.h>
#include "resource.h"
BOOL APIENTRY DlgProc(HWND Dlg,UINT message,WPARAM wParam,LPARAM lParam);
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
DialogBoxA(hInstance, "IDD_DIALOG1" ,NULL,(DLGPROC)DlgProc);
return 0;
}
//---------------------------------------------------------------------------
BOOL APIENTRY DlgProc(HWND hDlg,UINT uMsg,WPARAM wParam,LPARAM lParam)
{
switch (uMsg)
{
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
if (LOWORD(wParam) == IDOK)
{
CHAR st[256];
UINT valeur = GetDlgItemInt(hDlg, IDC_EDIT1, NULL, FALSE);
wsprintfA(st, "Vous avez choisi le nombre %d", valeur);
MessageBoxA(hDlg, st, "Résultat", MB_OK);
}
if (LOWORD(wParam) == IDCANCEL)
{
EndDialog(hDlg,0);
return TRUE;
}
default:
return FALSE;
}
} |