473,471 Members | 2,008 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Definition of WINVER

Hello,

Using someting like #define WINVER 0x0500 in a header file works
perfect, i.e. the preprocessor sees the definition. But I would like to set
WINVER in the IDE (Properties -> C/C++ -> Preprocessor -> Preprocessor
Definitions).
Doing this the symbol seems not to get defined and the preprocessor sets
WINVER to a default value of 0x0501.
Defining a symbol MY_TEST in the IDE shows the same problem: it's
simply not seen as defined by the preprocessor.

Any idea what's wrong ?

Many thanks Felix
PS: Im am using Visual Studio .NET 2003

Feb 26 '06 #1
6 4480
Hi Felix!
Using someting like #define WINVER 0x0500 in a header file works
perfect, i.e. the preprocessor sees the definition. But I would like to set
WINVER in the IDE (Properties -> C/C++ -> Preprocessor -> Preprocessor
Definitions).
Doing this the symbol seems not to get defined and the preprocessor sets
WINVER to a default value of 0x0501.
Defining a symbol MY_TEST in the IDE shows the same problem: it's
simply not seen as defined by the preprocessor.
How have you defined it?
You should add:

other-defines,WINVER=0x0500

You also should define "_WIN32_WINNT" and "_WIN32_IE"

If you have the latest PSDK you could also use the "NTDDI_WIN2K" macros...
See: Using the Windows Headers
http://msdn.microsoft.com/library/en...ws_headers.asp


Any idea what's wrong ?

Many thanks Felix
PS: Im am using Visual Studio .NET 2003

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Feb 26 '06 #2
I did exactly what you mentioned: added WINVER=0x0500 in the window that
appears when I select Properties -> C/C++ -> Preprocessor -> Preprocessor
Definitions.
There is not really much one can do wrong here?
I also tried to check and uncheck 'Inherit from project defaults' but this
did not help.

Any other idea?
"Jochen Kalmbach [MVP]" <no********************@holzma.de> wrote in message
news:OV**************@TK2MSFTNGP11.phx.gbl...
Hi Felix!
Using someting like #define WINVER 0x0500 in a header file works
perfect, i.e. the preprocessor sees the definition. But I would like to set WINVER in the IDE (Properties -> C/C++ -> Preprocessor -> Preprocessor
Definitions).
Doing this the symbol seems not to get defined and the preprocessor sets
WINVER to a default value of 0x0501.
Defining a symbol MY_TEST in the IDE shows the same problem: it's
simply not seen as defined by the preprocessor.
How have you defined it?
You should add:

other-defines,WINVER=0x0500

You also should define "_WIN32_WINNT" and "_WIN32_IE"

If you have the latest PSDK you could also use the "NTDDI_WIN2K" macros...
See: Using the Windows Headers

http://msdn.microsoft.com/library/en...ws_headers.asp

Any idea what's wrong ?

Many thanks Felix
PS: Im am using Visual Studio .NET 2003

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/

Feb 26 '06 #3
"Felix" <fb@ltec.ch> wrote in message news:46************@individual.net...
I did exactly what you mentioned: added WINVER=0x0500 in the window that
appears when I select Properties -> C/C++ -> Preprocessor -> Preprocessor
Definitions.
There is not really much one can do wrong here?
I also tried to check and uncheck 'Inherit from project defaults' but this
did not help.

Any other idea?


If you look at the compiler command line command (you can find this in the
buildlog.htm file)
what does it look like? does it have /D "WINVER=0x500" somewhere?

another possibility is that WINVER is explicitly set to something else in
your main include file, for example in StdAfx.h?
Also, it could be that if you did not recompile StdAfx.cpp, the compiler
still uses the WINVER that was used when StdAfx.cpp was compiled previously.
It depends on the original settings in your project.

--

Kind regards,
Bruno.
br**********************@hotmail.com
Remove only "_nos_pam"
Feb 26 '06 #4
Many thanks for the tip Bruno,

I just did not check the buildlog.html file. After doing so there is no good
news: as
I already stated the IDE seems to completly ignore what I enter, i.e. I can
not find
the expected WINVER=0x0500 in in buildlog.html.
Please note that it's not a WINVER specific problem since any /D I enter is
ignored by
the IDE and does not appear in the build log.

Very strange ..., ?!
"Bruno van Dooren" <br**********************@hotmail.com> wrote in message
news:eV**************@TK2MSFTNGP12.phx.gbl...

If you look at the compiler command line command (you can find this in the
buildlog.htm file)
what does it look like? does it have /D "WINVER=0x500" somewhere?

another possibility is that WINVER is explicitly set to something else in
your main include file, for example in StdAfx.h?
Also, it could be that if you did not recompile StdAfx.cpp, the compiler
still uses the WINVER that was used when StdAfx.cpp was compiled previously. It depends on the original settings in your project.

--

Kind regards,
Bruno.
br**********************@hotmail.com
Remove only "_nos_pam"

Feb 26 '06 #5
Hi Felix!
I just did not check the buildlog.html file. After doing so there is no good
news: as
I already stated the IDE seems to completly ignore what I enter, i.e. I can
not find
the expected WINVER=0x0500 in in buildlog.html.
Please note that it's not a WINVER specific problem since any /D I enter is
ignored by
the IDE and does not appear in the build log.

Very strange ..., ?!


Can you reduce the project to a minimum and then sent it to me?
jochen addd kalmbachnet dotttttt de
--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Feb 26 '06 #6
First of all, many thanks for all of your help!

The problem is resolved now. In one of my earlier posts I stated
that I have checked the project settings for the preprocessor, including
the option 'Inherit from project defaults'. This is true but I missed to
check
this option for _each_ sourcefile in my project, which in the end reveald
the
error: sourcefiles generating the 'WINVER not defined' message all had
the option 'Inherit from project defaults' _not_ checked and therefore the
preprocessor settings (including WINVER=0x0500 of course) were overwritten
'localy' for those sourcefiles.
Deleting all 'local' preprocessor settings and setting the 'Inherit from
project defaults'
option for those sourcefiles resolved the problem.

Either these settings have never been correct or there must have been some
change when I moved from VC6 to VC.NET.

again many thanks for your help, Felix

"Felix" <fb@ltec.ch> wrote in message news:46************@individual.net...
Hello,

Using someting like #define WINVER 0x0500 in a header file works
perfect, i.e. the preprocessor sees the definition. But I would like to set WINVER in the IDE (Properties -> C/C++ -> Preprocessor -> Preprocessor
Definitions).
Doing this the symbol seems not to get defined and the preprocessor sets
WINVER to a default value of 0x0501.
Defining a symbol MY_TEST in the IDE shows the same problem: it's
simply not seen as defined by the preprocessor.

Any idea what's wrong ?

Many thanks Felix
PS: Im am using Visual Studio .NET 2003

Feb 27 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Dave H | last post by:
Hello, I have a query regarding definition lists. Is it good practice semantically to use the dt and dd elements to mark up questions and answers in a frequently asked questions list, or FAQ? ...
7
by: Neil Zanella | last post by:
Hello, I have posted the following message before but got no replies... I am trying to format an HTML definition list with CSS so that it appears as follows, but am having the following problem:...
0
by: Jeff Collett | last post by:
Hi, When compiling with C++.NET 2003 I get a statement, WINVER not defined:Defaulting to 0x0501 ( WIndows XP and Windows.NET Server ). Not sure what this means. Does not seem to affect the code...
14
by: Mike Hewson | last post by:
Have been researching as to why: <example 1> class ABC { static const float some_float = 3.3f; }; <end example 1>
10
by: Kobu | last post by:
My question is about the use and meaning of the terms "declaration" and "definition" as it pertains to the C language. I've read sources that mix the two up when talking about such things as...
1
by: RiaanDP | last post by:
Hi there, I'm new to VS2005, I only worked on VS .NET and VS6 before. I'm receiving a compiler warning on each file when I compile my program: WINVER not defined. Defaulting to 0x0502...
9
by: Jess | last post by:
Hello, I was told that if I declare a static class constant like this: class A{ static const int x = 10; }; then the above statement is a declaration rather than a definition. As I've...
15
by: vaib | last post by:
hi to all.i'd like to know the actual difference between variable declaration and definition.it would be very helpful if anyone out there wud help me out with this thing.i'm writing here after here...
275
by: Astley Le Jasper | last post by:
Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob'
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.