Print Page | Close Window

Cannot reboot while GUI_VisualStudio.exe is runnin

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=24201
Printed Date: 25 April 2024 at 12:16pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Cannot reboot while GUI_VisualStudio.exe is runnin
Posted By: calvi
Subject: Cannot reboot while GUI_VisualStudio.exe is runnin
Date Posted: 28 August 2021 at 10:49am
GUI_VisualStudio.exe built with v19.3.0 using VS2019 16.11.2 prevents Windows 10, 21H1 from rebooting and locks itself up.  This can be fixed by editing XTPHookManager.cpp and inserting the following code at the start of CXTPHookManager::HookWndProc:

    if (message == WM_ENDSESSION)
        return 0;

A variation of this, seen in my own program, is that the following code later in that function results in an out of memory exception which also locks up:

        pSink = XTPHookManager()->Lookup(hWnd);

That fix cures both problems.



Replies:
Posted By: calvi
Date Posted: 21 September 2021 at 12:09pm
This bug is also present in v20.1.0.


Posted By: agontarenko
Date Posted: 13 October 2021 at 7:46am
Hello,

During normal application closing called CXTPWinApp::ExitInstance() function.
All global codejock library variables should be removed in XTPShutdown() function that called from CXTPWinApp::ExitInstance().
Before XTPShutdown() call all dialogs or frames windows should be closed. Global variables already not used and can be deleted.


During application closing with CFrameWnd::OnEndSession() function
system will called pApp->ExitInstance() function that remove all global variables that currently used in CFrameWnd derived class, after this you get problem that your discribed.



This document discribed Restart Manager API https://docs.microsoft.com/en-us/windows/win32/rstmgr/guidelines-for-applications. I think you need to get WM_CLOSE message during shutdown and application will be closed without problem.

Regards,
Artem Gontarenko


Posted By: calvi
Date Posted: 13 October 2021 at 8:12am
Thanks for your suggestion, but GUI_VisualStudio is not my code!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net