Change C++ target application to XP - c++

I built a C++ application with Microsoft Visual Studio 2012, but when tried it in Windows XP, it returns "not valid win 32 application".
I found some similar questions in stackoverflow and the msdn blog, and all of them say to change the toolkit plateform to XP, but in my case i didn't find this option.
I tried to make an update to the ** C++ redistrubitable** , but this doesn't solve the issue.
Does anyone have an idea about the problem?

You need to build your app using windows xp targeting tool set. You can download it here. More info on msdn.

The Microsoft website offers a great description of creating and modifying Win32 Applications.
They even offer a video that gives you a step by step on creating such a thing and any other questions you may have regarding Win32 applications.
Also, you can download and build your application using Windows XP Targeting Tool Set.

Related

WinUSB Tutorial from MSDN Microsoft

I've been faced with problem to follow this tutorial of Write a Windows desktop app based on the WinUSB template from MSDN of Microsoft. Following the instructions, in the step where we need to create an WinUSB Application, the website tell us that two projects will be create, but in my application just one project is created.
I'm using Microsoft Visual Studio Community 2015, and I had installed the WDK. Note: I'm using Windows 10 64 bits.
Below is available the part of the tutorial saying that two projects was created:
Below is available a screenshot of my Solution Explorer:
Can you help me to figure out what it's happened and help me to solve this?
Actually, I'm working on a WinUSB project too. And, it seems like Microsoft split the WinUSB application and the driver package into two different projects.
You should be able to see each of the individual projects when you try to create a new project.
Check the picture below.
The WinUSB INF Driver Package project will contain the INF file you need.
WinUSB Projects

What if I don't compile DLLs with vs110_xp?

By default Visual Studio 2012 does not support Windows XP nor Windows Server 2003. And before Update 1 those OSes weren't supported at all. Now with Update 1, I can use Visual Studio 2012 to create apps that target Windows XP and Windows Server 2003 by choosing to use the vs110_xp toolset. Great.
I wonder what happens when I forget to do that? What does "does not support" mean? Executables just don't run: "... is not a valid Win32 application."
But what will happen when I use such DLLs on XP? I cannot seem to find any information about that. And unfortunately I currently cannot try it out. Anyone found specific issues?
The program simply won't be able to start and fails immediately. The most important change in VS2012 is that it now specifies Windows version 6.0 in the /SUBSYSTEM linker option. Window XP will notice this, it is version 5.02, throw up its hands and fails the EXE start request or DLL load with ERROR_BAD_EXE_FORMAT.
Pretty important change btw, the appcompat shims that Windows turns on for executables that say that they were made to work on old Windows versions are fairly troublesome. The Aero lies are hard to deal with, should you care. The CRT was changed a great deal as well, using many more winapi functions that are only available in 6.0 and up. The Update1 revision limps along when it discovers them missing.

Can I deploy for Windows 2000 using Qt 4.8.4?

I have created an application using Qt 4.8.4, and now I have to distribute it on Windows 2000 machines, among the others. I have already tried searching over the Internet for a clear explanation about it, but I can't find a confirmation on what's the older Windows version actually supported by Qt.
The application runs fine on Windows XP (both 32 and 64 bit) and Windows 7 but, when I try to launch it on Windows 2000 I receive the well-known error "[Application name].exe is not a valid win32 application.", and I guess that the error relies on the unsupported Windows version.
The application is a "simple" one, it just need QtCore4.dll and QtGui4.dll as dependencies.
If it can help, I am developing on a Windows 7 64 bit machine, using Qt 4.8.4 and Qt Creator 2.7.1. If I go under Tools->Options->Build&Run->Kits->Manual->Desktop, I have "Microsoft Visual C++ Compiler 10.0 (x86)" as the compiler in use. Do I have to select a different one, maybe?
Thanks for any answer.
EDIT: What I've done after reading #vahancho's answer:
"Move" the project from Qt Creator to Visual Studio 2010, using CMake;
Install Visual Studio Express 2008 (enabling the V90 Platform Toolset, this way)
Open the project from VS2010, and go under Project Properties->Configuration Properties->General and change Platform Toolset to V90;
Recompile the project;
Now, I've tried to run the application compiled this way on a virtual machine, mounting Windows 2000, but I get another error, this time: "The procedure entry point DecodePointer could not be located in the dynamic link library KERNEL32.dll".
Well, after some investigations I found that running MSVC10 applications on Windows 2000 is not possible. You have to build it with at most MSVC9 (Visual Studio 2008), or use the VS2010 Multi Targetting feature to let VC++2010 use the VC++2008 compilers and libraries. Please also refer to this Microsoft Connect discussion.
OK, some time has passed, but I'd like to give a definitive answer to this question of mine. Unfortunately, what I was asking for it's not possible. #vahancho's answer is right, and the solution he pointed out is correct for the majority of situations. However, DecodePointer is "included" in Windows XP SP 2 kernel, and it's not possible to compile an application using it for an older Microsoft OS, even by choosing the VC++2008 compiler.
An additional reference is given by this post on CodeProject.
Fortunately for me, my application was simple enough to let me rewrite it using the good old VB6 :)

Deploy a C program compiled in VS2010

I have a compiled an older C++ program that runs fine in debug mode in VS2010 converted to VC++ 6 but I have no idea how to package or deploy the application.
VS2010 may not have anything to do with deploying the program at all but I thought I should mention it.
The "release" folder not only contains the executable but some "obj", "tlog", "vc100.pdb", "exe.intermediate.manifest" and "lastbuildstate".
This application is being installed on Windows Mobile OS (hopefully). It isn't as simple as copying the executable to the device is it?
Do I need to create a cab file or msi and, if so, how?
I am absolutely new at this being spoiled in C# and MVC for far too long!
Visual Studio 2010 does not have any of the Smart Device compilers (managed or native) required to even build for Windows Mobile (not Windows Phone). You must use Visual Studio 2008 to build, deploy and/or debug.
EDIT
FWIW, Studio 2012 will have support for Smart Devices (Studio 2010 still won't get support) in Q1 of next year. Backward-compatibility has yet to be announced, but it's always possible that you'll be able to develop for WinMo devices using the ARM compiler. There's a video here detailng some of the features.
Have you done a search on google yet? While I don't know anything about deploying to a windows phone, a quick google search found a few hits.
I searched for 'deploy windows phone app' and found a few things. Among which are:
http://msdn.microsoft.com/en-us/library/windowsphone/develop/gg588378(v=vs.92).aspx
http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff928362(v=vs.92).aspx
Last of all, it looks like this has been asked before on this website. For instance:
Can you install you own apps on your windows 7 phone

C++ Win32 API offline documentation?

I'm learning win32 apps with C++. I've got a pretty good API reference, but it's from 1997. Is there a more modern version available for download?
My connection is horrendous so I'd like it to be fully accessible offline. Something akin to a chm or hlp file...searchable and up to date-ish.
If you install the Windows SDK, it comes with all the documentation as well. The download is enormous though, but at least you can do it all-at-once.
Here's another download which is just the documentation (and slightly out-of-date, but still covers 99% of the Win32 API): MSDN Library for Visual Studio 2008 SP1
For complete reference of Win32 API(of course the content is still slightly out of date) I keep both MSDN Library for Visual Studio 2008 SP1
and Software Development Kit Update for Windows Vista
Because for some reason the 2008 SP1 contains stripped down content.