views:

65

answers:

2

We are using a 3rd party library that sometimes does not work correctly on Win7. WE know how to configure this at installation time, but we'd also like to consider setting it at run time. Is this possible, or does that context have to be set prior to launch? (I think there is a slim to none chance, but figured I would ask anyway)

(C++ application - not that it really matters)

+2  A: 

The compatibility settings can't be changed once the application is running.

However, what you could do is have a launcher application that makes sure the compatibility settings are correct and then launches your application. Of course, you need to make sure the launcher application doesn't have compatibility problems.

Ben S
That's what we figured - just making sure we weren't missing a trick.
Tim
A: 

The compatibility settings are merely preprocessor macros that block out parts of the Win32 API in the header files that are not available on the selected platform.

However because the entire API is provided by DLLs you can determine what OS is running at run-time and then get the necessary platform specific entry points using LoadLibrary and GetProcAddress.

Clifford
That is interesting - but that is not what I am asking about
Tim
Ah, I see reading again, you are referring to "installation time" rather than "build time", and to a 3rd party library, not the Win32 API. In that case then perhaps the 'accepted' answer is not correct either. I'd say that it depends entirely in the third-party library and what it does on "installation". To be honest I am not clear what you mean by that. However if this library uses the same technique as the Win32 API, and is a DLL, then teh same applies.
Clifford