• 您的位置我爱Aspx >> VC.Net >> 走出MFC子类化的迷宫
  • 走出MFC子类化的迷宫

  • 作者:aspxer  来源:internet  日期:2007-5-21 23:49:05  关键字:
  • if (*lplpfn == NULL)

    *lplpfn = oldWndProc; // the first control of that type created

    #ifdef _DEBUG

    else if (*lplpfn != oldWndProc)

    {

    TRACE0("Error: Trying to use SubclassWindow with incorrect CWnd\n");

    TRACE0("\tderived class.\n");

    TRACE3("\thWnd = $%04X (nIDC=$%04X) is not a %hs.\n", (UINT)hWnd,

    _AfxGetDlgCtrlID(hWnd), GetRuntimeClass()->m_lpszClassName);

    ASSERT(FALSE);

    // undo the subclassing if continuing after assert

    ::SetWindowLong(hWnd, GWL_WNDPROC, (DWORD)oldWndProc);

    }

    #endif

    return TRUE;

    }

    函数Attach内部如下:

    BOOL CWnd::Attach(HWND hWndNew)

    {

    ASSERT(m_hWnd == NULL); // only attach once, detach on destroy

    ASSERT(FromHandlePermanent(hWndNew) == NULL);

    // must not already be in permanent map

    我对这篇文章有话说?
  • 广告位招租,广告代号:content_468_15
  • 上一篇:传递自动化字符串数组
    下一篇:C#和C++的速度大比拼(二)
  • 相关文章