//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by Script1.rc
//
#define IDD_MAIN                        103// Next default values for new objects
// 
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE        101
#define _APS_NEXT_COMMAND_VALUE         40001
#define _APS_NEXT_CONTROL_VALUE         1000
#define _APS_NEXT_SYMED_VALUE           101
#endif
#endif
#include "stdafx.h"
#include "resource.h"
LRESULT CALLBACK WndProcMain(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int i=0;
switch(message)
{
case  WM_CREATE:
::MessageBox(hWnd,"asdf",NULL,MB_OK);
break;
case WM_INITDIALOG:
ShowWindow(hWnd, SW_SHOW);
break;
case WM_LBUTTONDOWN:
if(i==0)
break;
case WM_LBUTTONUP:
if(i==0)
break;
}
return 0;
}
int APIENTRY wWinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
  // TODO: Place code here. HWND hwnd= CreateDialog(hInstance, MAKEINTRESOURCE(IDD_MAIN), NULL, (DLGPROC)WndProcMain);
int ret=GetLastError();
MSG msg;

while(GetMessage(&msg,NULL,0,0)){
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return 0;
}错误码是1406,这是为什么啊?CreateDialog怎么用啊?