Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Decide you for optimizing for speed or secure code
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Decide you for optimizing for speed or secure code

 Post Reply Post Reply
Author
Message
Michl View Drop Down
Senior Member
Senior Member


Joined: 14 September 2007
Status: Offline
Points: 138
Post Options Post Options   Thanks (0) Thanks(0)   Quote Michl Quote  Post ReplyReply Direct Link To This Post Topic: Decide you for optimizing for speed or secure code
    Posted: 22 November 2007 at 1:14pm
While debugging I stepped about following code in
 

void CXTPReportControl::OnDraw(CDC* pDC)
 
 

CXTPReportHeader* pHeader = GetReportHeader();

CRect rcHeader = m_rcHeaderArea;
rcHeader.right = rcHeader.left + pHeader->GetWidth();
// draw header
if (pHeader)
   pHeader->Draw(pDC, rcHeader, m_nLeftOffset);
 
// draw group by box
if (pHeader)
   pHeader->DrawGroupByControl(pDC, m_rcGroupByArea);
 
Optimizing I:

if (pHeader)
{
   pHeader->Draw(pDC, rcHeader, m_nLeftOffset);
   pHeader->DrawGroupByControl(pDC, m_rcGroupByArea);
}
 
Optimizing II:

pHeader->Draw(pDC, rcHeader, m_nLeftOffset);
pHeader->DrawGroupByControl(pDC, m_rcGroupByArea);
 
Because if pHeader is really null, then it crash already in line above (pHeader->GetWidth();)
 
A a nice day
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: 22 November 2007 at 4:42pm

Optimizing III: "Whole program optimization" -> Visual C++ owns you 2007

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.125 seconds.