两者的参数是一致的,返回值不同,
他们和CWND::ONCREATE的关系是怎样的??
看了半天MSDN,越来越糊涂了

解决方案 »

  1.   

    cwnd::createEx 是MFC CWnd的成员函数必须有CWnd对象调用比如
    Cwnd mywnd;
    mywnd.CreateEX()而CreateWindowEx
    是window的api函数当然, cwnd::createEx最终是调用CreateWindowEx
    来实现窗口的创建的可以说cwnd::createEx是对 CreateWindowEx的封装(所以他们的参数几乎一样)
      

  2.   

    CreateWindowEx函数是操作系统的API函数,而CWnd::CreateEx是MFC对API函数CreateWindowEx函数的一层封装OnCreate函数是窗口的WM_CREATE消息的响应函数
      

  3.   

    CreateEx是类CWnd的创建函数,会引发OnCreate事件
    CreateWindowEx是API函数,创建窗口,不会引起OnCreate事件的发生
      

  4.   

    两者的参数是一致的,返回值不同,
           this is because the CWnd::CreateEx 's implementation calls 
    CreateWindowEx  API internally!
           the HWND handle return by CreateWindowEx Win32 API is stored in 
    CWnd::m_hWnd,so it just to return the BOOL to indicate whether our Cratewindow
    call is successfully executed!
    他们和CWND::ONCREATE的关系是怎样的??
    virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RE..)
    is called before Windows calls CreateWindow[Ex] for it. So the m_hWnd is NULL then .However the OnCreate handler for WM_CRATE is called after CCreateWindow[Ex] 
    CWnd::Create[Ex] returns!    
      

  5.   

    However the OnCreate (Message handler for WM_CRATE )is called after CreateWindow[Ex] but before function
    CWnd::Create[Ex] returns!