This documentation is archived and is not being maintained.


Call to create and initialize the Windows frame window associated with the CFrameWnd object.

virtual BOOL Create(
   LPCTSTR lpszClassName,
   LPCTSTR lpszWindowName,
   const RECT& rect = rectDefault,
   CWnd* pParentWnd = NULL,
   LPCTSTR lpszMenuName = NULL,
   DWORD dwExStyle = 0,
   CCreateContext* pContext = NULL 


Points to a null-terminated character string that names the Windows class. The class name can be any name registered with the AfxRegisterWndClass global function or the RegisterClass Windows function. If NULL, uses the predefined default CFrameWnd attributes.
Points to a null-terminated character string that represents the window name. Used as text for the title bar.
Specifies the window style attributes. Include the FWS_ADDTOTITLE style if you want the title bar to automatically display the name of the document represented in the window.
Specifies the size and position of the window. The rectDefault value allows Windows to specify the size and position of the new window.
Specifies the parent window of this frame window. This parameter should be NULL for top-level frame windows.
Identifies the name of the menu resource to be used with the window. Use MAKEINTRESOURCE if the menu has an integer ID instead of a string. This parameter can be NULL.
Specifies the window extended style attributes.
Specifies a pointer to a CCreateContext structure. This parameter can be NULL.

Return Value

Nonzero if initialization is successful; otherwise 0.


Construct a CFrameWnd object in two steps. First, invoke the constructor, which constructs the CFrameWnd object, and then call Create, which creates the Windows frame window and attaches it to the CFrameWnd object. Create initializes the window's class name and window name and registers default values for its style, parent, and associated menu.

Use LoadFrame rather than Create to load the frame window from a resource instead of specifying its arguments.

See Also

CFrameWnd Overview | Class Members | Hierarchy Chart | CFrameWnd::CFrameWnd | CFrameWnd::LoadFrame | CCreateContext | CWnd::Create | CWnd::PreCreateWindow