Solved

_WIN32_WINNT and _WIN32_IE

Posted on 2012-03-27
7
1,043 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Specific format 21 181
Explain Unit of Work pattern 2 57
What is MicroStrategy.NET? 2 58
Why is compiler in oracle server ? 9 44
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see 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.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

910 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

22 Experts available now in Live!

Get 1:1 Help Now