Updated: October 2008
Creates the specified child window and attaches it to the
virtual BOOL Create(
Const RECT& rect,
CCreateContext* pContext = NULL
Pointer to a null-terminated string that contains the name of a registered system window class; or the name of a predefined system window class.
Pointer to a null-terminated string that contains the window display name; otherwise
for no window display name. NULL [in] dwStyle
Bitwise combination (OR) of
window styles. The WS_POPUP option is not a valid style. [in] rect
The size and location of the window relative to the top-left corner of the parent window.
Pointer to the parent window.
ID of the window.
Pointer to a
CCreateContext structure that is used to customize the document-view architecture for the application. if the method was successful; otherwise TRUE . FALSE
AfxRegisterWndClass function to register window classes. User defined window classes are available in the module where they are registered.
method is called before the CWnd::OnCreate Create method returns, and before the window becomes visible.
// Dynamically create static control using CWnd::Create,
// instead of with CStatic::Create, which doesn't
// need the "STATIC" class name.
// m_pWndStatic is a CWnd* member of CMyDlg
m_pWndStatic = new CWnd;
m_pWndStatic->Create(_T( "STATIC"), _T( "Hi"), WS_CHILD | WS_VISIBLE,
CRect(0, 0, 20, 20), this, 1234);
Updated whole topic.