I am trying to understand the barriers to porting a C++ MFC application that runs on x86 Windows 10 to an ARM Windows 10 device with the Qualcomm Snapdragon processor.
The 32 bit application has the following characteristics:
- MFC with C++ used for the user interface
- C used for the business logic
- the source code is divided into about 30 different projects, some static libraries, some DLLs, some EXE
- relies on Windows API for multi-threading, semaphores, mutexes, cryptology
- uses COM objects from Third Party providers, OPOS Service Objects and OPOS Control objects
- relies on local instance of SQL Server Express using ADO for database
This application compiles fine with Visual Studio 2015/2017/2019 targeting x86 and Windows 10.
My question is: what are the possible barriers to migrating this application to ARM Windows 10 using the Snapdragon processor?
A secondary question is what would be an appropriate, low cost ARM Windows 10 device? Most Windows 10 ARM Snapdragon devices from HP, Samsung, and Lenovo seem to be in the US$800 and up pricing and I'd like something more inexpensive as in less than US$200.
A side question: will the Snapdragon 410 processor work for initial testing and compatibility checks. I'm looking at the DragonBoard 410C from Arrow as a low cost test platform. https://www.arrow.com/en/products/dragonboard410c/arrow-development-tools
This DragonBoard™ 410C based on 96Boards™ specification features the Qualcomm® Snapdragon™ 410 processor, a Quad-core ARM® Cortex™ A53 at up to 1.2GHz clock speed per core, capable of 32-bit and 64-bit operation.96Boards is a 32-bit and 64-bit ARM® Open Platform hosted by Linaro™ with the intension to serve the software/ maker and embedded OEM communities. DragonBoard 410C supports Android 5.1, Linux based on Debian and Win10 IoT Core advanced processing power, WLAN, Bluetooth, and GPS, all packed into a board the size of a credit card. It is designed to support feature-rich functionality, including multimedia, with the Qualcomm® Adreno™ 306 GPU, integrated ISP with up to 13 MP camera support, and 1080p HD video playback and capture with H.264 (AVC).
The DragonBoard 820C may be a more appropriate test hardware as it is closer to what most Windows 10 ARM Snapdragon product offerings are shipping with. https://www.arrow.com/en/products/dragonboard820c/arrow-development-tools
What I have been able to find thus far
This posted question, Win32 support on Windows 10 , seems to be the closest to my question however there is no real answer. The accepted answer says "There's no x86 Win32 emulation at all. You need to use a toolset designed for the platform." which appears to be wrong according to the following articles:
Right now, with Windows 10 on ARM laptops, it’s possible to run 32-bit x86 desktop software using emulation, but not dedicated 64-bit software like, say, Adobe’s Premiere Pro video editing app for example.
https://channel9.msdn.com/Events/Build/2017/P4171 is a video that mentions x86 emulation
https://docs.microsoft.com/en-us/windows/uwp/porting/apps-on-arm-x86-emulation discusses x86 emulation
Emulation for x86 apps makes the rich ecosystem of Win32 apps available on ARM. This provides the user the magical experience of running an existing x86 win32 app without any modifications to the app. The app doesn’t even know that it is running on a Windows on ARM PC, unless it calls specific APIs (IsWoW64Process2)
Windows 10 on ARM is completely different [from Windows/RT]. This is the full Windows desktop experience. Microsoft has created a special emulator layer that allows traditional 32-bit desktop applications to run on ARM processors, so everything should “just work”. Microsoft even showed off a version of Windows 10 Professional on ARM, and said it supports all the usual advanced features you’d find on Windows 10 Professional.
The emulation works completely transparently to both users and the programs they run. It uses the same WOW (Windows on Windows) technology that Windows uses to run 32-bit applications on 64-bit versions of Windows today. However, the x86-to-ARM emulation happens entirely in software.
Compiling for ARM with VS 2017 and software component considerations
This article, https://pete.akeo.ie/2017/05/compiling-desktop-arm-applications-with.html , provides some details about compiling desktop applications for ARM using Visual Studio 2017.
This article, https://support.microsoft.com/en-us/help/4521606/windows-10-arm-based-pc , under the section about limitations mentions:
Drivers for hardware, games and apps will only work if they're designed for a Windows 10 ARM-based PC. For more info, check with the hardware manufacturer or the organization that developed the driver. Drivers are software programs that communicate with hardware devices—they're commonly used for antivirus and antimalware software, printing or PDF software, assistive technologies, CD and DVD utilities, and virtualization software.
If a driver doesn’t work, the app or hardware that relies on it won’t work either (at least not fully). Peripherals and devices only work if the drivers they depend on are built into Windows 10, or if the hardware developer has released ARM64 drivers for the device.
The article also says in the same section:
64-bit (x64) apps won’t work. You'll need 64-bit (ARM64) apps, 32-bit (ARM32) apps, or 32-bit (x86) apps. You can usually find 32-bit (x86) versions of apps, but some app developers only offer 64-bit (x64) apps.
Here is a Microsoft portal to Windows 10 on ARM documentation, https://docs.microsoft.com/en-us/windows/arm/ with links to various resources on the page as well as a left hand sidebar with additional documentation links.
Some considerations and additional information
Can SQL Server Express (or any version) run on RPi? and the answer appears to be there is no ARM version of SQL Express. However there is a comment that says there is an ARM version of SQL Server Compact. SQL Server Compact has been replaced by SQL Server localDB however I'm not sure if there is an ARM version of that or not however it seems to use parts of SQL Server so an ARM version seems doubtful. See https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/sql-server-express-localdb?view=sql-server-ver15
On the other hand it looks like Microsoft is releasing Azure SQL Edge which does run on x64 and ARM64. https://azure.microsoft.com/en-us/services/sql-edge/
This Developer Minute video from Microsoft describes the steps to enable ARM64 builds in Visual Studio. https://www.youtube.com/watch?v=OZtVBDeVqCE&feature=youtu.be and there are also instructions at this link https://blogs.windows.com/windowsdeveloper/2018/11/15/official-support-for-windows-10-on-arm-development/
