none
Migrating Visual Studio 2013 MFC C++ application to VS 2015 that must be still executable on Windows 7

    Question

  • Hello, I have a question migrating Visual Studio 2013 MFC C++ application to VS 2015 that be still executable on Windows 7.

    If the target is Windows 7 you should set Target Platform Version to 8.1 (since Windows SDK 8.1 is backward compatible to those (Windows 7 and Vista) platformsand you should define the appropriate value for _WIN32_WINNT in targetver.h. For Windows 7, that's 0x0601 as decribed here: https://msdn.microsoft.com/en-us/library/8x480de8.aspx

    Questions:

    1. Should I set the Platform Toolset to "Visual Studio 2015 (v140)" or "Visual Studio 2013 (v120)"? What is the exact difference?
    2. Should or must I define the  appropriate value for _WIN32_WINNT in targetver.h?

    I created a C++ MFC Application (all default settings) with Visual Studio 2015 (no extra define set for _WIN32_WINNT in targetver.h) and executed with success on Windows 7.

    Can you explain this and tell me what I have exactly to do to support Windows 7?
    Thanks for the help,


    Andreas

    Wednesday, January 13, 2016 12:09 PM

Answers

  • 1. Should I set the Platform Toolset to "*Visual Studio 2015 (v140)*" or "*Visual Studio 2013 (v120)*"? What is the exact difference?

    That sets which toolset (compiler/linker, etc) are used to build your
    code. If you're doing only native code it shouldn't matter (providing
    the compiler can compile your code) - use the latest. It's more of an
    issue when you're doing managed code as the toolset is tied to the
    .Net version.

    2. Should or must I define the  appropriate value for* _WIN32_WINNT* in *targetver.h?

    It'd be wise. The values are intended to restrict the header file
    definitions so that you can't easily use an API that's only available
    on newer OS's.

    I created a C++ MFC Application (all default settings) with Visual Studio 2015 (no extra define set for_WIN32_WINNT* in *targetver.h*) and executed with success on Windows 7.

    Presumably you've not used any functions that aren't available with
    Win7.

    Dave

    Wednesday, January 13, 2016 4:47 PM