CWnd::Create

Syntax

BOOL Create( const char FAR* lpClassName, const char FAR* lpWindowName, DWORD dwStyle, const RECT& rect, const CWnd* pParentWnd, UINT nID );

Parameters

lpClassName

Points to a null-terminated character string that names the Windows class (a WNDCLASS struct). The class name can be any name registered with the AfxRegisterWndClass function or any of the predefined control-class names. If NULL, uses the default CWnd attributes. See CreateEx for a description of the possible values.

lpWindowName

Points to a null-terminated character string that contains the window name.

dwStyle

Specifies the window style attributes. See CreateEx for a description of the possible values.

rect

The size and position of the window, in client coordinates of pParentWnd.

pParentWnd

The parent window.

nID

The ID of the child window.

Remarks

Creates a Windows child window and attaches it to the CWnd object.

You construct a child window in two steps. First, invoke the constructor, which constructs the CWnd object, then call Create, which creates the Windows child window and attaches it to CWnd. Create initializes the window's class name and window name, and registers values for its style, parent, and ID.

Return Value

TRUE if initialization is successful; otherwise FALSE.

See Also

CWnd::CWnd, CWnd::CreateEx