?
Solved

_WIN32_WINNT and _WIN32_IE

Posted on 2012-03-27
7
Medium Priority
?
1,081 Views
Last Modified: 2012-08-14
In some code I inherited, written by someone else, appears:

#if ((_WIN32_WINNT < _WIN32_WINNT_WIN2K) && (_WIN32_IE > _WIN32_IE_IE60SP1))
#error _WIN32_WINNT settings conflicts with _WIN32_IE setting
#endif

No issue when building in MS VC++ version 6.0.  Now I'm porting to VS2008, and this error is occuring.   Can someone explain what it means and how I fix it?  Thanks!
0
Comment
Question by:tullhead
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 2000 total points
ID: 37772650
Well, depending on your Windows version, set _WIN32_WINNT accordingly, since it is either undefined or set to a version prior to W2k. E.g. for XP, that would be

#define _WIN32_WINNT 0x500

Open in new window


Or _WIN32_WINNT=0x500 in your project settings under "Configuration Properties|C/C++|Preprocessor" in "Preprocessor Definitions"
0
 

Author Comment

by:tullhead
ID: 37772718
So, this code should run on both XP and Win7 -- so how do I set it?
0
 
LVL 86

Expert Comment

by:jkr
ID: 37772763
If you need it to run on XP as well, just use the above - this will ensure that no Win7-specific code will be used.
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 35

Expert Comment

by:sarabande
ID: 37781754
the _WIN32_WINNT macro was formerly used in header files to distuingish between WIN95/WIN98/WINME and WINNT-systems like WIN2K/WINXP/VISTA/WIN7 systems. setting the macro to at least WIN2K made a few functions available which needed the improved multitasking capability of the WINNT systems for example CreateWaitableTimer function. for application programming with mfc those functions normally were not needed and therefore the macro _WIN32_WINNT was not set at all or set to a WINNT version which was the minimum target version of the os where the software should run. since Visual C++ .NET (2002) a few more functions required higher os versions (means they would not run any more on win2k) and sometimes 3rd-party libraries also protected their software for being used at systems before xp. sometimes it wasn't actually necessary but they did it for maintanance reasons. if you run into such a problem as a user of such libraries, you firstly should check that the macros were defined at all and if not define them in your projects to the mimimum (target) operation system (respectively IE version) you want to support. if that conflicts with the versions required in the headers you could try to compile without including the header that makes the trouble. if that doesn't work you could try to find out  whether increasing your version number to the required level really makes problems (what could be difficult to make sure) or you increase your minimum target version accordingly.

Sara
0
 
LVL 86

Expert Comment

by:jkr
ID: 37782231
Is there any point in adding the obvious in a long-wound way?
0
 
LVL 35

Expert Comment

by:sarabande
ID: 37782422
jkr, the explanation wasn't for you but for the questioner.

but you will not longer get bored by my comments cause i will leave the forum in the next time.

Sara
0
 

Author Closing Comment

by:tullhead
ID: 37883816
sorry for slow acceptance of the answer -- on IE 9, I clicking on "Accept as answer" does not work - so have to log on here using my old XP system with older IE to accept this....
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question