![]() |
[SOLVED] Report doesn't paint if out of GDI memory |
Post Reply ![]() |
Author | |
Sergio ![]() Senior Member ![]() ![]() Joined: 18 September 2006 Status: Offline Points: 216 |
![]() ![]() ![]() ![]() ![]() Posted: 05 March 2010 at 9:52am |
Hello,
Our customers are working with many windows using your report control and have large screen display. At a certain point, the report control window is left unpainted and seems to hang, but after resizing the window it comes back to life. After looking at your code, we saw that you don't check if the bitmap buffer was successfully created : void CXTPReportControl::OnPaint() { ... CDC memDC; memDC.CreateCompatibleDC(&dc); m_bmpCache.DeleteObject(); m_bmpCache.CreateCompatibleBitmap(&dc, rc.Width(), rc.Height()); ... Should be : ... BOOL bUseBuffer = FALSE; CDC* pDC = &dc; CDC memDC; if (memDC.CreateCompatibleDC(&dc)) { m_bmpCache.DeleteObject(); if (m_bmpCache.CreateCompatibleBitmap(&dc, rc.Width(), rc.Height())) { �bUseBuffer = TRUE; �pDC = &memDC; �... } } ... Perform drawings using pDC ... if (bUseBuffer) { ... Blit memDC to dc ... } ... Could you please fix it, thank you. Regards, |
|
Sergio
|
|
![]() |
|
znakeeye ![]() Senior Member ![]() ![]() Joined: 26 July 2006 Status: Offline Points: 1672 |
![]() ![]() ![]() ![]() ![]() |
Perhaps CXTMemDC could be updated with this type of logic. Then you could use it in the report control too. |
|
PokerMemento - http://www.pokermemento.com/
|
|
![]() |
|
Sergio ![]() Senior Member ![]() ![]() Joined: 18 September 2006 Status: Offline Points: 216 |
![]() ![]() ![]() ![]() ![]() |
Thank you for your answer, but are you talking to Codejock's developers? I don't want to rewrite the OnPaint() of the report control... |
|
Sergio
|
|
![]() |
|
Sergio ![]() Senior Member ![]() ![]() Joined: 18 September 2006 Status: Offline Points: 216 |
![]() ![]() ![]() ![]() ![]() |
Hello,
Any news regarding this issue? Do you plan to fix it? |
|
Sergio
|
|
![]() |
|
ABuenger ![]() Newbie ![]() ![]() Joined: 02 February 2006 Status: Offline Points: 1075 |
![]() ![]() ![]() ![]() ![]() |
Code has been updated for 15.0.3
Double buffering can now also be disabled altogether, EnableDoubleBuffering(FALSE); If double buffering fails it falls back to direct drawing. |
|
Codejock support
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |