GUI application Execution fails after porting an application from VS2015 to VS2022.

Sai Krishna 0 Reputation points
2025-01-06T04:24:05.24+00:00

There is a GUI Application that is based on C++ that we are trying to update from VS2015 to VS2022. The application after the upgrade is not functioning as expected. The executable does not even open although the build is successful. In VS2015 though, the build is working perfectly on the expected lines.

While trying to debug the code with the VS Debugger goes through the following function :

int __cdecl TestStartup()
{
  return WinMainCRTStartup();
}
int

WinMainCrtStartup() is supposed to call a function called WinMain(). During this stage simultaneously on the Visual Studio debugger, its showing that its trying to load a set of DLLs before breaking. We could observe a difference in the working VS2015 vs the non functioning VS2022 on the list of DLLs that is loaded from C:\Windows\System32 shown on Output Section in VS Debugger

VS2015 :

Ntdll.dll, kernel32.dll, KernelBase.dll, gdi32.dll, win32u.dll, gdi32full.dll, msvcp_win.dll, ucrtbase.dll , user32.dll, advapi32.dll, msvcrt.dll, sechost.dll, bcrypt.dll, rpcrt4.dll, shell32.dll, psapi.dll , winmm.dll , wininet.dll, imm32.dll, Uxtheme.dll, Combase.dll, Kernel.appcore.dll, Ole32.dll, Comctl32.dll, oleaut32.dll, shlwapi.dll, bcryptprimitives.dll, windows.storage.dll, WinTypes.dll, SHCore.dll, cmedit64d.dll, GdiPlus.dll, msctf.dll, TextShaping.dll, TextInputFramework.dll , CoreMessaging.dll, CoreUIComponents.dll, Cryptbase.dll, AudioSes.dll, winmmbase.dll , MMDevAPI.dll, avrt.dll, ksuser.dll, devobj.dll, cfgmgr32.dll, cfgmgr32.dll, msacm32.dll, midimap.dll, clbcatq.dll, powrprof.dll, umpdc.dll, ResourcePolicyClient.dll

VS2022 :

Ntdll.dll, kernel32.dll, KernelBase.dll, gdi32.dll, win32u.dll, gdi32full.dll, msvcp_win.dll, ucrtbase.dll , user32.dll, advapi32.dll, msvcrt.dll, sechost.dll, bcrypt.dll, rpcrt4.dll, shell32.dll, psapi.dll , winmm.dll , wininet.dll, imm32.dll

We are trying to fix this issue while updating to VS2022. Tried checking various project configurations but unable to figure out a specific reason for this issue.

Note: The same application is built and executed successfully with console.
If any issues with specific versions related to visual studio and its dll's can be notified.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,337 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,818 questions
Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
1,015 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.