Application written in Visual Studio 2017 does not run/open in Windows 7 Machine - visual-studio-2017

I have an MFC application developed in Visual studio 2017 (Windows 10). When i tried to install the application in Windows 7 machine it does not open/run. I tried to install updates needed for windows 7 as suggested in https://support.microsoft.com/en-in/help/3118401/update-for-universal-c-runtime-in-windows but it does not help. Is there anything else that is missing

Related

Build project compatible with Windows XP, 7 and 10 in Visual Studio 2019

My operating environment: Windows 10, Visual Studio 2019
Target PC: Windows xp, Windows 7, Windows 10 (for now, all considered as 64bit)
I want to do a distribution that is not dependent on the target OS. For example, I give only one installer to clients, and they might be able to run the program on Windows xp, Windows 7, or Windows 10.
In Project Properties in Visual Studio 2019 what things should I check for that?
Plus, should I compile and build my project in each target platform?
When using Visual Studio 2017 v141_xp toolset in VS2019 , the target platform windows sdk will be modified to sdk 7 automatically.
From SDK 7 description:
this SDK can be used to develop applications for Windows 7,
Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008
Although Windows 7 exe can be opened with compatibility on Windows 10, I recommend preparing separate build settings for Windows 7 and 10.

Can I use Visual Studio 2015 for creating Windows Phone 8 applications?

I have Visual Studio 2015 Community edition installed with Windows Desktop development tools (languag - C++). Can I use it for creating Windows Phone 8 application with C++ language (especially with C++11/14 standard)? Which SDK\tools I have to install for this task or may be all required instruments are in Visual Studio 2015 Community package alredy?
Thank you for help.
P.S.: The "Visual Studio 2015 Platform Targeting and Compatibility" article, in the section "Visual Studio 2015 Support for Windows Universal, Windows Store, and Windows Phone App Development", says that Windows Phone 8 apps are supported by the Visual Studio 2015 but with footnotes "Supports migration of Windows Phone 8 projects to Windows Phone Silverlight 8.1.". So, I can't understand, does Visual Studio 2015 support the whole development cycle for Windows Phone 8 app or only migration to the Windows Phone 8.1?
UPDATE: I mean the Windows Runtime applications for Windows Phone 8 platform.
sure, you need to download windows phone 8/8.1 sdk from microsoft website
https://www.microsoft.com/en-in/download/details.aspx?id=35471 or from somewhere which provide standalone installer for this.
after this, just open up visual studio go to c++ the expand windows > windows phone

How to target Windows XP in Microsoft Visual Studio C++ [duplicate]

This question already has answers here:
MSVCP140.dll missing
(4 answers)
Closed 6 years ago.
I'm using Microsoft Visual Studio 2015 on Windows 8.1. I want to compile a program targeting Windows XP. I've looked it up on Google and other similar questions, but none helped. In the solution settings, target platform toolset is set to the Windows XP one, but there is no option for Windows XP in the target platform version.
I did read https://msdn.microsoft.com/en-us/library/windows/desktop/aa383745(v=vs.85).aspx (Using the Windows Headers) and added these lines to my program:
#define WINVER _WIN32_WINNT_WINXP
#define _WIN32_WINNT _WIN32_WINNT_WINXP
#define NTDDI_VERSION NTDDI_WINXP
But it still doesn't work. It says that it can't find "MSVCP140.dll". After I got this dll, it begins to complain about can't find "VC140.dll". After that is "ucrtbased.dll", and then finally "api-ms-win-core-string-11-1-0.dll", which I don't even have it in my Windows 8.1 computer. The program can run on Windows 8.1, but not Windows XP.
What can I do to make the program run on Windows XP?
In order to build a Windows XP compatible EXE with VS 2015 (or VS 2012 / VS 2013) you have to use the v140_xp Platform Toolset rather than the default v140 Platform Toolset.
UPDATE: Note that VS 2017 includes support for Windows XP via v141_xp. For VS 2019, this feature is no longer being updated but you can still install the v141_xp toolset to use with the VS 2019 IDE.
See your Project Properties, the General page:
This is because the default Platform Toolset uses the Windows 8.1 SDK (or you can opt into the Windows 10 SDK), and this only supports building applications for Windows Vista or later. When you select the v140_xp Platform Toolset, you are using a version of the Windows 7.1 SDK which was the last version to support targeting Windows XP or Windows Server 2003.
Note that Visual Studio can target Windows XP Service Pack 3 or Windows Server 2003 Service Pack 2. The C/C++ Runtime is not compatible with older versions of Windows.
If you are using DirectX in your app, this has some profound implications because a lot changed between the Windows 7.1 SDK and the Windows 8 SDK. See this post for details.
With VS 2015, you will also need to select the Windows XP support in the Custom Install options or via Programs & Features / Microsoft Visual Studio 2015 / Change... / Modify:
It sounds like the program runs fine on your development machine (Windows 8.1 + MSVS 2015), but doesn't run on an XP machine.
SOLUTION: you must include the MSVC runtime along with your .exe.
Look here: Deploying Native Desktop Applications (Visual C++)
and here: Visual C++ Redistributable for Visual Studio 2015.
Update from Chuck Walbourn -
Note that in the particular case of VS 2015 Update 3 and VS 2017, you
can use the VS 2017 or 2019 REDIST and it will work fine. See:
VC Runtime in MSVC 2017 is binary compatible with
2015
and
Microsoft Docs: C++ binary compatibility between Visual Studio
2015, 2017, and
2019.
And to repeat - your "setup" should include a compatible MSVC runtime (aka "VCRedist").

Visual Studio 2015 Change target platform to windows 7

How can I change the target platform to Windows 7? All I can chose is Windows 8.1 and therefore my project does not run on Windows 7. The same project I used to compile on my old Windows 7 PC with Visual Studio 2013. And of course it worked there.
I already tried to install Windows 7 SDK but sadly this does not work since it requites Net Framework 4.0 which I can not install anymore. (Windows 10 includes 4.6?) - https://msdn.microsoft.com/en-us/en-en/library/ff770576.aspx
Thanks.
From MSDN:
Target Platform Version
[...]
To target Windows 7 or Windows Vista, use the value 8.1, since Windows SDK 8.1 is backward compatible to those platforms. In addition, you should define the appropriate value for _WIN32_WINNT in targetver.h. For Windows 7, that's 0x0601. See Modifying WINVER and _WIN32_WINNT.
To get additional target platforms (i.e. older Visual C compilers), install the respective older Visual Studio version(s) in parallel.
For instance, if you want to use Visual Studio 2017 in the GUI and want to build against VC2008 (msvc90), install Visual Studio 2008 in parallel to Visual Studio 2017. In VS2017, in the build settings, you can then select the "VC 2008" build target.
Also see:
https://poweruser.blog/visual-studio-2017-compile-against-older-visual-c-c-runtimes-372519fe1400

Visual Studio 2015 RC Community Edition Target Platform set to Windows 10 TP on Windows 8.1

I just freshly installed Windows 8.1 and Visual Studio 2015 RC Community Edition.
The compilation of an existing c++ project failed, not finding <windows.h> for include. In order to fix that I installed Windows 8.1 SDK with no luck.
Looking into it my Project Settings for the "Win32" configuration says:
Why does VS2015 display Windows 10 as default target platform and why can't I change the value to Windows 8.1?
The installation of
Microsoft Visual Studio 2015 Tools for Windows 10 (Technical Preview)
and
Windows Software Development Kit - Windows 10.0.10069
seems to be done by default during Visual Studio 2015 RC setup.
The optional selection of Windows 8.1 and Windows Phone 8.0/8.1 Tools does not seem to install the respective Platform Toolsets properly alongside of the Windows X versions in order to be able to change that on the respective project settings page.
Uninstalling the above mentioned Tool- and SDK-Kits for Windows 10 made
Target Platform Windows
available in the Project Settings and I can choose Version 8.1 now.
Now <windows.h> is found again.
I had the same problem.
I changed the platform toolset to v140_xp, and closed VS2015. After opening VS2015 asked to install Windows XP C++ libraries, 225MB. After these steps my project was compiled successfully. Hope this helps you.