CWnd::CreateEx
Visual Studio 2010
Creates the specified window and attaches it to the CWnd object.
virtual BOOL CreateEx( DWORD dwExStyle, LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent, HMENU nIDorHMenu, LPVOID lpParam = NULL ); virtual BOOL CreateEx( DWORD dwExStyle, LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, LPVOID lpParam = NULL );
The default extended window style is WS_EX_LEFT. The default window style is WS_OVERLAPPED.
Use the AfxRegisterWndClass function to register window classes. User defined window classes are available in the module where they are registered.
Dimensions for child windows are relative to the top-left corner of the client area of the parent window. Dimensions for top-level windows are relative to the top-left corner of the screen.
The CWnd::OnCreate method is called before the CreateEx method returns, and before the window becomes visible.
The ID of a child window can no longer be 0.
http://connect.microsoft.com/VisualStudio/feedback/details/648513/cwnd-precreatewindow-change-causing-problems
Any child window must now have an ID other than zero.
CWnd::PreCreateWindow will assign one for you if you do not assign one.
This is in order for GetDlgItem to work correctly.
The change fixes a crash in managed/native interop scenarios.
There is a TRACE statement in CWnd::Create which attempts to alert the developer of the problem.
Any child window must now have an ID other than zero.
CWnd::PreCreateWindow will assign one for you if you do not assign one.
This is in order for GetDlgItem to work correctly.
The change fixes a crash in managed/native interop scenarios.
There is a TRACE statement in CWnd::Create which attempts to alert the developer of the problem.
- 3/16/2011
- GregM