Print Page | Close Window

[SOLVED] Report doesn't paint if out of GDI memory

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=16358
Printed Date: 29 September 2024 at 3:28am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [SOLVED] Report doesn't paint if out of GDI memory
Posted By: Sergio
Subject: [SOLVED] Report doesn't paint if out of GDI memory
Date 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



Replies:
Posted By: znakeeye
Date Posted: 05 March 2010 at 12:47pm

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/


Posted By: Sergio
Date Posted: 10 March 2010 at 12:00pm
Originally posted by znakeeye znakeeye wrote:

Perhaps CXTMemDC could be updated with this type of logic. Then you could use it in the report control too.



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


Posted By: Sergio
Date Posted: 05 May 2010 at 9:45am
Hello,

Any news regarding this issue?

Do you plan to fix it?



-------------
Sergio


Posted By: ABuenger
Date Posted: 11 April 2011 at 12:52pm
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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net