Solved

_WIN32_WINNT and _WIN32_IE

Posted on 2012-03-27
7
1,056 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 500 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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
LVL 34

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 34

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Having just graduated from college and entered the workforce, I don’t find myself always using the tools and programs I grew accustomed to over the past four years. However, there is one program I continually find myself reverting back to…R.   So …
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 use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
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…

738 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