Print Page | Close Window

Decide you for optimizing for speed or secure code

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=8864
Printed Date: 22 November 2024 at 2:15pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Decide you for optimizing for speed or secure code
Posted By: Michl
Subject: Decide you for optimizing for speed or secure code
Date 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



Replies:
Posted By: znakeeye
Date Posted: 22 November 2007 at 4:42pm

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




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