Can someone clear up this code so it will compile in visual c++ 6.0
#include <windows.h>
#include <tchar.h>
#include "resource.h" //this is a basic dialog box with a ok and cancel button
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);
// fall through
case IDCANCEL:
EndDialog(hWnd, wCommand);
break;
}
return TRUE;
}
int _tmain(void)
{
DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_DIALOG1), NULL, (DLGPROC)MainDialogProc, 0);
return 0;
}