Solved

_WIN32_WINNT and _WIN32_IE

Posted on 2012-03-27
7
1,047 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 33

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 33

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
wordappend challenge 8 172
Convert GUI app into console app for Win32 Env 5 99
WPF issue with Trigger 2 105
Message not shown 5 49
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
If you haven’t already, I encourage you to read the first article (http://www.experts-exchange.com/articles/18680/An-Introduction-to-R-Programming-and-R-Studio.html) in my series to gain a basic foundation of R and R Studio.  You will also find the …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

785 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