This code I have here should work but it will not compile on my machine. I have been trying to do this for about 2 hours now. My girlfriend is getting ........ed off at me because she wants to play and I won't get off intill I figure this out. When I build the code I get this error
:\My Documents\Source.cpp(10) : error C2065: 'MainDialog_OnCommand' : undeclared identifier
C:\My Documents\Source.cpp(19) : error C2373: 'MainDialog_OnCommand' : redefinition; different type modifiers
Error executing cl.exe.
What should I write or do with this code. I am getting fustratied I know for a fact this crap is not that hard to figure out for most of you people but I am having a hard time with this simple and easy task. sorry for bothering everyone.
#include <windows.h>
#include <tchar.h>
#include "resource.h"
BOOL MainDialogProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_COMMAND:
return MainDialog_OnCommand(hWnd, LOWORD(wParam), HIWORD(wParam), (HWND)lParam);
case WM_CLOSE:
EndDialog(hWnd, 0);
return TRUE;
}
return FALSE;
}
BOOL MainDialog_OnCommand(HWND hWnd, WORD wCommand, WORD wNotify, HWND hControl)
{
switch (wCommand)
{
case IDOK:
MessageBox(hWnd, _T("Bye-bye world!"), _T("Sample Application"), MB_OK);
case IDCANCEL:
EndDialog(hWnd, wCommand);
break;
}
return TRUE;
}
int _tmain(void)
{
DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_DIALOG1), NULL, (DLGPROC)MainDialogProc, 0);
return 0;
}