forgive me, please allow me to start from the begining.
I choose win32 project to create an empty project.
Then I import some existing codes to the project.(a Main.cpp file with WinMain, CMyDlg.h and CMyDlg.cpp file
implementing a dialog class CMyDlg, the CMyDlg.h having line enum{IDD = IDD_MYDLG})
Then I compile the codes, for I copy the IDD_MYDLG's defines in my .h file, so it compiles fine.

Then I notice, I've never renew a .rc file to create a dialog resource.
So I start from menu 'Insert'->'Resource' to create a dialog resource. and name the dialog resource
IDD_MYDLG.

In Main.cpp I declare a CMyDlg *ptrDlg;
Code:
ptrDlg = new CMyDlg;
if (ptrDlg)
{
	BOOL bRet = FALSE;
	bRet = ptrDlg->Create(CMyDlg::IDD);
}
But I still debug to find ptrDlg->Create return FALSE.
Then debug to follow, found the code here dlgcore.cpp
Code:
BOOL AFXAPI _AfxCheckDialogTemplate(LPCTSTR lpszResource, BOOL bInvisibleChild)
{
	ASSERT(lpszResource != NULL);
	HINSTANCE hInst = AfxFindResourceHandle(lpszResource, RT_DIALOG);-->Saying can't find the resource
	HRSRC hResource = ::FindResource(hInst, lpszResource, RT_DIALOG);
Saying can't find the resource.
I've add the resource, I can't clear my mind to figure out where's wrong.
Please help me unlock my mind!