With all the different versions of windows and the gradual addition of various API since 1995 what is the best way to ensure that I can retain support for older windows versions but still use newer API?

As an example if I want to include structured exception handling in my application, there is the classic (but messy) method of modifying fs:[0] and using either a frame based system or global memory to store chain of structures.

Or under XP I can use the functions AddVectoredExceptionHandler & RemoveVectoredExceptionHandler API. However since they are exported from Kernel32.dll the PE loader will refuse to run my app unless its the XP version of Kernel32.dll. I could then release different windows specific versions of my app with my own work around code in the non XP versions.

But then I may as well not bother to use the new functions at all and just write my own workaround code for a fully compatible (and slightly larger) app.

Is there any easy "solution" or am I just asking a retorical question?
Posted on 2002-08-25 02:00:03 by huh
Huh,

I think you are stuck with having to do it in a manner that works on the old version if you want backwards compatibility. It may suit Microsoft to lock programs into later versions but the vast majority of people with computers around the world that can run 32 bit windows programs do not have the later versions so you limit the application of your software by using the later version specific stuff.

Regards,

hutch@movsd.com
Posted on 2002-08-25 03:57:20 by hutch--
Huh,
in the case of functions that are exported from kernel components, i would advise you to use LoadLibrary and GetProcAddress. Then, at the start of your app, check what version of windoze you are running on, and use some IF-THEN type code to setup your error handling.
Posted on 2002-08-25 17:14:37 by sluggy