A question about versions....

Started by CommonTater, April 23, 2012, 09:53:19 PM

Previous topic - Next topic

CommonTater

Is there any correlation between Windows headers supplied with Pelles C and Window's versions?

For example:  If I were programmming on XP... should I be using Version 5? 

Thanks.


Stefan Pendl

I can't think of one, since defining WINVER should be enough to specify the minimum Windows release.
---
Stefan

Proud member of the UltraDefrag Development Team

CommonTater

Thanks Stephan...  WINVER... good to know.

This is the first time this concern came up as my "client" wanted me to ensure that his project would work on XP and it crossed my mind that versions of the headers (and libs) that post date XP may have stuff XP can't do in them...






Stefan Pendl

If WINVER is not defined, it will default to 0x0500, which is Win2k, see windef.h

WINVER is used to enable additional structure members for higher Windows versions and to use different API functions based on the minimum supported Windows version.

The OpenFileName structure would be an example of defining additional members for _WIN32_WINNT greater than or equal to 0x0500.

It even seems that _WIN32_WINNT is used for the majority of version checks in header files.
---
Stefan

Proud member of the UltraDefrag Development Team

CommonTater

Quote from: Stefan Pendl on April 24, 2012, 12:43:11 AM
If WINVER is not defined, it will default to 0x0500, which is Win2k, see windef.h

WINVER is used to enable additional structure members for higher Windows versions and to use different API functions based on the minimum supported Windows version.

The OpenFileName structure would be an example of defining additional members for _WIN32_WINNT greater than or equal to 0x0500.

It even seems that _WIN32_WINNT is used for the majority of version checks in header files.

Wow... now this I wasn't aware of...
Strange thing is I've been using structs and things as you describe with additional or different features, without defining winver... odd...

I feel some reading coming on... :D 

Thanks again.