Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Errors in XTP due to min/max macros
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Errors in XTP due to min/max macros

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


Joined: 16 May 2006
Status: Offline
Points: 139
Post Options Post Options   Thanks (0) Thanks(0)   Quote akur Quote  Post ReplyReply Direct Link To This Post Topic: Errors in XTP due to min/max macros
    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!

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
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.156 seconds.