1

近 20 年来,我一直在开发 MFC MDI 应用程序。它适用于 Windows 98、Windows XP 和 Windows 7。但它在 Windows 10 上失败了......有什么想法,为什么?这是代码:

class CEdytorDocFrame : public CMDIChildWnd
{
    DECLARE_DYNCREATE(CEdytorDocFrame)

public:
    CSplitterWnd m_wndSplitter;
    CSplitterWnd m_wndSplitter2;
    CStatusBar  m_wndStatusBar;

}
IMPLEMENT_DYNCREATE(CEdytorDocFrame, CMDIChildWnd)

CEdytorDocFrame::CEdytorDocFrame() :
    m_nOldCY(0),
    m_nOldEditH(1),
    m_nOldViewH(1),
    m_nOldEditMinH(0),
    m_nOldViewMinH(0)
{
} // CEdytorDocFrame::CEdytorDocFrame()

BOOL CEdytorDocFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) 
{
    CDebug::WriteLog("CEdytorDocFrame::OnCreateClient(), enter");
    /*
    ** Create status bar
    */
    if(!m_wndStatusBar.CreateEx(this, SBT_TOOLTIPS | SBARS_SIZEGRIP) ||
        !m_wndStatusBar.SetIndicators(indicators, countof(indicators)))
    {
        TRACE0("Failed to create status bar\n");
        return FALSE;
    }
    CDebug::WriteLog("CEdytorDocFrame::OnCreateClient(), status bar created");

    /*
    ** Calculate heights and widths
    */
    int wndW, wndH, treeW, treeH, viewW, editW;
    wndW = lpcs->cx;
    m_nOldCY = wndH = lpcs->cy;
    // Set tree pane to be 1/4 of total width and maximum height
    treeW = wndW/4;
    treeH = 0;
    // Set edit pane to be 4/7 height of edit window and maximum width
    m_nOldEditH = MulDiv(wndH, 4, 7);
    editW = 0;
    // Set preview pane to be 3/7 height of edit window and maximum width
    m_nOldViewH = wndH-m_nOldEditH;
    viewW = 0;
    CDebug::WriteLog("CEdytorDocFrame::OnCreateClient() wndW=%d, wndH=%d, treeW=%d, treeH=%d, viewW=%d, editW=%d",
                        wndW, wndH, treeW, treeH, viewW, editW);

    // Create panels
    if(!m_wndSplitter.CreateStatic(this, 1, 2))
    {
        TRACE0("Failed to create static splitter\n");
        return FALSE;
    }
    CDebug::WriteLog("CEdytorDocFrame::OnCreateClient(), 1st splitter created");

LastWriteLog()没有被执行,所以我怀疑CreateStatic()......但为什么只在 Windows 10 上?

4

0 回答 0