看板 C_and_CPP 關於我們 聯絡資訊
請問一下各位 我程式執行到一半 他就會出現 a require resource was 的訊息 然後就會給我一個中斷 中斷點在這 _AFXWIN_INLINE CGdiObject* CDC::SelectObject(CGdiObject* pObject) { ASSERT(m_hDC != NULL); return SelectGdiObject(m_hDC, pObject->GetSafeHandle()); } 出錯點如下 請問有沒有人遇過呢 謝謝喔 BOOL CTouch_sensorDlg::TileBitmap(CDC* pDC, CRect rc) { CDC MemDC; int x = 0, y = 0; // If there is a bitmap loaded if (m_BmpPattern.m_hObject != NULL) { MemDC.CreateCompatibleDC(pDC); //出錯點 CBitmap* pOldBitmap = MemDC.SelectObject(&m_BmpPattern); // Tile the bitmap while (y < rc.Height()) { while(x < rc.Width()) { pDC->BitBlt(x, y, m_nBmpWidth, m_nBmpHeight, &MemDC, 0, 0, SRCCOPY); x += m_nBmpWidth; } x = 0; y += m_nBmpHeight; } MemDC.SelectObject(pOldBitmap); //pOldBitmap->DeleteObject(); MemDC.DeleteDC(); DeleteObject(m_BmpPattern); return TRUE; } return FALSE; // Normal behaviour } // End of TileBitmap -- -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 219.87.157.211