473,383 Members | 1,980 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

about the "#if (_WIN32_WINNT >= 0x0501)" in the system headers....

In my code I would like to use the constant (define in WinGdi.h)
CLEARTYPE_QUALITY
But that doesn't work!!
(it's for CreateFont(...))

A quick look at the header reveal that:
== WinGdi.h fragment ===
#if (_WIN32_WINNT >= 0x0500)
#define CLEARTYPE_QUALITY 5
#endif
===================

Now I wonder, how do I define _WIN32_WINNT ?
- should I just go into Project Properties => Configuration => C/C++ /
Preprocessor => Definition
and put some random value?

- beside how will this work?
generally speaking my product work on Windows 2000 & XP and this constant is
not a bit flag, it's a number (other constant are 1,2,3,4)

Any tips? advice? ideas? suggestion?
May 27 '06 #1
9 8911
Hi Lloyd!
A quick look at the header reveal that:
== WinGdi.h fragment ===
#if (_WIN32_WINNT >= 0x0500)
#define CLEARTYPE_QUALITY 5
#endif
===================

Now I wonder, how do I define _WIN32_WINNT ?
- should I just go into Project Properties => Configuration => C/C++ /
Preprocessor => Definition
and put some random value?
It should not be random...
See: Using the Windows Headers
http://msdn.microsoft.com/library/en...ws_headers.asp
If you have a current PSDK, you should set "NTDDI_VERSION"
generally speaking my product work on Windows 2000 & XP and this constant is
not a bit flag, it's a number (other constant are 1,2,3,4)


The define
NTDDI_VERSION=NTDDI_WIN2K
in your project settings

Or (for older PSDKs):
_WIN32_WINNT=0x0500
WINVER=0x0500

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
May 27 '06 #2

"Lloyd Dupont" <net.galador@ld> wrote in message
news:eM**************@TK2MSFTNGP02.phx.gbl...
In my code I would like to use the constant (define in WinGdi.h)
CLEARTYPE_QUALITY
But that doesn't work!!
(it's for CreateFont(...))

A quick look at the header reveal that:
== WinGdi.h fragment ===
#if (_WIN32_WINNT >= 0x0500)
#define CLEARTYPE_QUALITY 5
#endif
===================

Now I wonder, how do I define _WIN32_WINNT ?
- should I just go into Project Properties => Configuration => C/C++ /
Preprocessor => Definition
and put some random value?
surely not a random value.
- beside how will this work?
generally speaking my product work on Windows 2000 & XP and this constant
is not a bit flag, it's a number (other constant are 1,2,3,4)

Any tips? advice? ideas? suggestion?
#define _WIN32_WINNT 0x0501

in stdafx.h will do best.


May 27 '06 #3
Thanks!
May 27 '06 #4
Thanks!
May 27 '06 #5
"Egbert Nierop (MVP for IIS)" wrote:
generally speaking my product work on Windows 2000 & XP and this constant
is not a bit flag, it's a number (other constant are 1,2,3,4)

Any tips? advice? ideas? suggestion?


#define _WIN32_WINNT 0x0501

in stdafx.h will do best.


Keep in mind that if you are defining _WIN32_WINNT to a specific value
because an API requires it, it is because that API requires at least that
version of Windows to run.

Therefore, if your product must work on Windows 2000, and you are using an
API that requires at least Windows XP (which is what setting _WIN32_WINNT to
0x0501 means), then you are going to have a problem later on when you try to
run your product on Windows 2000.

For your particular situation, ClearType wasn't introduced until WinXP.
Depending on what you are doing with ClearType, you may need to write code to
ascertain which version of Windows is running and to take action accordingly.

Sean
May 27 '06 #6
Thanks for addressing the second part of my question!
I though along those lines:
all these constants are just increasing number (1,2,3,4 and 5 for cleartype)
not only it should be available for windows 2000 in a service pack but,
hopefully, the function should gracefuly either of:
-use a known lower number
-use default DRAFT quality instead....
Anyway, any tip on how to write a simple test of the current OS?

thanks!
"Sean M. DonCarlos" <se********@newsgroups.nospam> wrote in message
news:96**********************************@microsof t.com...
"Egbert Nierop (MVP for IIS)" wrote:
> generally speaking my product work on Windows 2000 & XP and this
> constant
> is not a bit flag, it's a number (other constant are 1,2,3,4)
>
> Any tips? advice? ideas? suggestion?


#define _WIN32_WINNT 0x0501

in stdafx.h will do best.


Keep in mind that if you are defining _WIN32_WINNT to a specific value
because an API requires it, it is because that API requires at least that
version of Windows to run.

Therefore, if your product must work on Windows 2000, and you are using an
API that requires at least Windows XP (which is what setting _WIN32_WINNT
to
0x0501 means), then you are going to have a problem later on when you try
to
run your product on Windows 2000.

For your particular situation, ClearType wasn't introduced until WinXP.
Depending on what you are doing with ClearType, you may need to write code
to
ascertain which version of Windows is running and to take action
accordingly.

Sean

May 28 '06 #7
"Lloyd Dupont" <net.galador@ld> wrote in message
news:uI**************@TK2MSFTNGP05.phx.gbl...
Anyway, any tip on how to write a simple test of the current OS?


The short answer to the question is to say that you call GetVersionEx().

But you have to understand that if you build an application so that it only
runs on 2K or better, and if someone tries to launch that binary on NT4 say
(a platform which should be retired IMO) that your application may not ever
get to the point of calling GetVersionEx().

An application will fail to load if it makes implicit reference to a
function in a DLL which is not present at load time.

Regards,
Will
May 28 '06 #8
"William DePalo [MVP VC++]" <wi***********@mvps.org> wrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
"Lloyd Dupont" <net.galador@ld> wrote in message
news:uI**************@TK2MSFTNGP05.phx.gbl...
Anyway, any tip on how to write a simple test of the current OS?
The short answer to the question is to say that you call GetVersionEx().

But you have to understand that if you build an application so that it
only runs on 2K or better, and if someone tries to launch that binary on
NT4 say (a platform which should be retired IMO) that your application may
not ever get to the point of calling GetVersionEx().

An application will fail to load if it makes implicit reference to a
function in a DLL which is not present at load time.


If the DLL is not present, the application fails to load. If the DLL is
present but an older version so the function is missing, the application
loads and only fails if it tries to call that function, correct?

Regards,
Will

May 29 '06 #9
"Ben Voigt" <rb*@nospam.nospam> wrote in message
news:ew**************@TK2MSFTNGP05.phx.gbl...
If the DLL is not present, the application fails to load. If the DLL is
present but an older version so the function is missing, the application
loads and only fails if it tries to call that function, correct?


No.

At least not if you link the DLL implicitly. If you do that, at runtime the
loader will display a message box which says something like this:

"The procedure entry point XXXX could not be located in dynamic link
library YYYY".

Regards,
Will


May 29 '06 #10

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

Similar topics

2
by: leroybt.rm | last post by:
I don't understand why this does not work: <FILE1> test1.py #Import Packages import string # data=0 data=data+1
1
by: Christian Schmidbauer | last post by:
Hello! I prepare my XML document like this way: ------------------------------------------------------- PrintWriter writer; Document domDocument; Element domElement; // Root tag
7
by: Diandian Zhang | last post by:
Does anyone have an idea, how to do it? Thanks in advance!
3
by: H. S. | last post by:
Hi, I am trying to compile these set of C++ files and trying out class inheritence and function pointers. Can anybody shed some light why my compiler is not compiling them and where I am going...
145
by: Sidney Cadot | last post by:
Hi all, In a discussion with Tak-Shing Chan the question came up whether the as-if rule can cover I/O functions. Basically, he maintains it can, and I think it doesn't. Consider two...
4
by: Don Wash | last post by:
Hi All! I'm getting the following Error: No DLLs has been compiled yet and nothing in the \bin directory. So it is not the versioning problem or anything like that. And here are the...
1
by: tomy | last post by:
Hi Group: The confusing code is as below: //------------------------------------------------- #if #define FOO foo #else #define FOO foobar #endif...
3
by: Steven.Xu | last post by:
hi everybody, i am useing some classes which in System.Xml to deal with xml document. what can i do if the document include "<" or ">"? Thanks.
1
by: ismailc | last post by:
Hi, I need help please. Update system to to new version & moved on to .Net2 But now my code that worked in my .Net1 xslt does not work. .Net1 fine: <xsl:stylesheet...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.