Problem with MemDC on W2K
-
Hey, I've developed a custom control with uses a memDc to draw flickerfree. The control works perfectly on WinXP but not on W2k. In W2k is instead of the control a blank screen. Can somebody help me.
CDC dcMem; CBitmap *bmpMem; CBitmap* pOldBmp=NULL; bmpMem = new CBitmap(); if(dcMem.CreateCompatibleDC(pDC)) { if(bmpMem->CreateCompatibleBitmap(pDC,iBitmapWidth,iBitmapHeight)) pOldBmp = dcMem.SelectObject(bmpMem); else return -10; } else return -9; //................Hier wird gezeichnet //------------------------------------- pDC->BitBlt(reRect.left, reRect.top, iBitmapWidth, iBitmapHeight, &dcMem, reRect.left, reRect.top +m_iVertScrollbarPos, SRCCOPY);
-
Hey, I've developed a custom control with uses a memDc to draw flickerfree. The control works perfectly on WinXP but not on W2k. In W2k is instead of the control a blank screen. Can somebody help me.
CDC dcMem; CBitmap *bmpMem; CBitmap* pOldBmp=NULL; bmpMem = new CBitmap(); if(dcMem.CreateCompatibleDC(pDC)) { if(bmpMem->CreateCompatibleBitmap(pDC,iBitmapWidth,iBitmapHeight)) pOldBmp = dcMem.SelectObject(bmpMem); else return -10; } else return -9; //................Hier wird gezeichnet //------------------------------------- pDC->BitBlt(reRect.left, reRect.top, iBitmapWidth, iBitmapHeight, &dcMem, reRect.left, reRect.top +m_iVertScrollbarPos, SRCCOPY);
I have had similar problems - sounds like it is creating a very large buffer because of some system dependent call that returns a very large value that causes an error. Check the Scrollbar values for example to see if this is the case - that it returns a large eroneous value.
A cynic is a man who, when he smells flowers, looks around for a coffin.
-H.L. Mencken