Solved

_WIN32_WINNT and _WIN32_IE

Posted on 2012-03-27
7
1,036 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
  • 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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 32

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 32

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.
The viewer will learn how to implement Singleton Design Pattern in Java.

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now