Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - [SOLVED] Report doesn't paint if out of GDI memory
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

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

 Post Reply Post Reply
Author
Message
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED] Report doesn't paint if out of GDI memory
    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
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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/
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 05 May 2010 at 9:45am
Hello,

Any news regarding this issue?

Do you plan to fix it?

Sergio
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (1) Thanks(1)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.