GUI application Execution fails after porting an application from VS2015 to VS2022.
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.