Print Page | Close Window

Errors in XTP due to min/max macros

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=13887
Printed Date: 11 May 2025 at 10:22am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Errors in XTP due to min/max macros
Posted By: akur
Subject: Errors in XTP due to min/max macros
Date Posted: 01 April 2009 at 3:58am
Hello,

because of the currently running porting of our product to x64, we're starting to use constructs __min/__max all over in our code base instead of historic min/max macros. This is an easy replacement to do in our own sources.

But since XTP sources also use these old min/max macros and we do not wish to modify XTP sources (to keep version upgrade maintenance low), we're forced to apply the macro NOMINMAX to XTP sources. However, introducing this macro in header files makes the _order_ in which headers are included into sources very error-prone - an incorrect order of includes could then lead to XTP compilation errors like these:

xtremetoolkitpro\source\common\XTPVC50Helpers.h(569) : error C3861: 'min': identifier not found
xtremetoolkitpro\source\common\XTPVC50Helpers.h(569) : error C3861: 'max': identifier not found
xtremetoolkitpro\source\reportcontrol\XTPReportControl.h(3504) : error C3861: 'max': identifier not found
xtremetoolkitpro\source\calendar\XTPCalendarUtils.h(1022) : error C3861: 'min': identifier not found
xtremetoolkitpro\source\calendar\XTPCalendarPaintManager.h(1272) : error C3861: 'min': identifier not found
xtremetoolkitpro\source\calendar\XTPCalendarTimeLineViewTimeScale.h(221) : error C3861: 'max': identifier not found
xtremetoolkitpro\source\syntaxedit\XTPSyntaxEditDrawTextProcessor.h(511) : error C3861: 'max': identifier not found



That's why we would like to have a free order of includes so that the order is independent of whether min/max is used in some of them or not.

To achive this, it would be great to have these replacements done directly by CodeJock.
Could you please replace the usage of min/max macros in XTP sources with __min/__max versions?

Thank you, in advance!




Replies:
Posted By: Oleg
Date Posted: 01 April 2009 at 4:23am
Hello,
 
You can just add
#define max __max 
#undef max
 
before and after you include toolkit in stdafx.h
 
 
 
And btw what point to replace max to __max. What problem with max ?


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



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