release版本不能运行,debug是好使的
CMainWindow继承于 CFrameWnd。设置断点,单步运行,release版本的毛病出在 Create 函数,debug版没有问题
BOOL CMainWindow::PreCreateWindow(CREATESTRUCT& cs){ CFrameWnd::PreCreateWindow(cs); cs.dwExStyle = cs.dwExStyle & (!WS_EX_CLIENTEDGE); cs.style = cs.style & (~ WS_SIZEBOX); cs.style = cs.style & (~ WS_MAXIMIZEBOX); return TRUE;}CMainWindow::CMainWindow(){ CRect r; r.left = CW_USEDEFAULT; r.top = CW_USEDEFAULT; r.right = r.left+ 500 + ::GetSystemMetrics(SM_CYBORDER)*2; r.bottom = r.top + 373 + ::GetSystemMetrics(SM_CYBORDER)*2 + ::GetSystemMetrics(SM_CYMENU) + ::GetSystemMetrics(SM_CYCAPTION); Create(NULL, L"鹏来电脑", WS_OVERLAPPEDWINDOW , r);}