#define AFX_WS_DEFAULT_VIEW (WS_CHILD | WS_VISIBLE | WS_BORDER)
你在create时,将AFX_WS_DEFAULT_VIEW传进去,视图在创建时后立刻显示
至于为何会崩溃,就不太清楚了,会不会是其它参数的问题
CWnd::Create
virtual BOOL Create( LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
Return Value
Nonzero if successful; otherwise 0.
Parameters
lpszClassName
Points to a null-terminated character string that names the Windows class (a WNDCLASS structure). The class name can be any name registered with the global AfxRegisterWndClass function or any of the predefined control-class names. If NULL, uses the default CWnd attributes.
lpszWindowName
Points to a null-terminated character string that contains the window name.
dwStyle
Specifies the window style attributes. WS_POPUP cannot be used. If you wish to create a pop-up window, use CWnd::CreateEx instead.
rect
The size and position of the window, in client coordinates of pParentWnd.
pParentWnd
The parent window.
nID
The ID of the child window.
pContext
The create context of the window.
Remarks
Creates a Windows child window and attaches it to the CWnd object.