我编写的Windows程序为什么显示不了对话框
程序如下(为方便阅读,已简化),我在项目中也编辑好了对话框资源,但是无论如何对话框都显示不出来,请各位高手给点意见。#include <windows.h>
#include "resource.h"
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ;
BOOL CALLBACK AboutDlgProc (HWND, UINT, WPARAM, LPARAM) ;
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{
static TCHAR szAppName[] = TEXT ("About1") ;
MSG msg ;
HWND hwnd ;
WNDCLASS wndclass ;
初始化 wndclass;
注册 wndclass;
hwnd = CreateWindow (…) ;
DialogBox (hInstance, TEXT ("DIALOG"), hwnd, AboutDlgProc) ;
ShowWindow (hwnd, iCmdShow) ;
UpdateWindow (hwnd) ;
while (GetMessage (&msg, NULL, 0, 0))
{
TranslateMessage (&msg) ;
DispatchMessage (&msg) ;
}
return msg.wParam ;
}
LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
return DefWindowProc (hwnd, message, wParam, lParam) ;
}
BOOL CALLBACK AboutDlgProc (HWND hDlg, UINT message,WPARAM wParam, LPARAM lParam)
{
return FALSE ;
}