App类中的BOOL CMyApp::InitInstance()函数中
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CMyDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
NULL);//注意,要设成空,这样消息才能在各个视图中传递
AddDocTemplate(pDocTemplate);