When I exit game via exit game node, Unreal tries to send a crash report - crash

I made a small node that will exit the game when I press escape. This issue wasn't happening at first but a crash report shows up every time I exit the game using it. I can just exit out of it, but it is annoying.
Script to exit
Crash Report

Related

How to catch Delphi App shutting down when run in IDE?

Scenario
Using Delphi 2009 on Windows 10 I have an app that performs shut down operations such as logging and database manipulation.
Anywhere the user is able to exit the app I call Form.Close on the main form which calls a procedure to do the required operations. This works ok regardless of whether the user exits via the menu or by using the Windows task bar icon to close the window (as some of my users do).
Problem
When debugging the app in the IDE however, clicking the red square in the Delphi menu bar to stop the app running does not call Form.Close and hence doesn't call my shut down procedure.
Question
Is there a way to make the app correctly call form.close when shut down via the IDE so that I can ensure all parts get debugged?
Other info
I've looked here which describes a method using WMQueryEndSession to catch windows shut down messages but when I use that code in my app it is not called when the IDE shuts down the application, so maybe the IDE is using a different method.
Code used in my WMQueryEndSession procedure
procedure TFrmMain.WMQueryEndSession(var Msg: TWMQueryEndSession);
{intercept the shut down message and call our proc first
SafeFormClose is very simple and quick so no issues.
Also called first in case the inherited procedure shuts us down
before SafeFormClose has a chance to run}
begin
SafeFormClose; //Do our shut down and logging stuff
Msg.Result := 1; //Signal that it is OK for Windows to shut us down
inherited; //Do whatever the original handler would have done.
end;
If you are running the program in debugger, clicking the red square (reset button) terminates the program immediately. The debugger has full control of the program, and no more code is run after you click the reset button.
This is different than for example terminating the program in the task manager (in which case Windows would send a close signal to the program, which could reject it if it doesn't want to close yet).
You should design the program so that if it stops at any point, the next time it is started it fixes any problems caused by the reset (for example fixes corrupted database files). This is a real situation that can occur when power is lost or the operating system crashes. You cannot trust that your shutdown routine can be run every time.

Debug.print statement causes a System.Configuration.ConfigurationErrorsException?

I am writing a VB.net application and in the form load I have a simple debug.print statement as per below:
Debug.Print("Application Started " & Format(Date.Now, "dd-MMM-yyyy hh:mm:ss tt"))
The application was running fine and I didn't have any errors but then I did something and I started getting an error. The last thing I did before noticing the error was I did a search and replace of a variable name start and I renamed this to startSearchIdx and I think it replaced text in my form1.designer.vbcode as I had to back out this change.
First this error only occurs on this current project. If I create a new VB.net windows form project with a button and this code then all is good, so it must be a setting or something in a configuration file which is causing the error?
When I run the application in debug mode, the application stops on the DEBUG.PRINT line as per the below image and I also receive the message:
A first chance exception of type 'System.Configuration.ConfigurationErrorsException' occurred in System.Configuration.dll"
in the Immediate window. However if press F5 and continue then the application starts, and I see:
Application Started 16-Oct-2019 04:55:24 PM"
in the debug window.
The application then runs fine and any future debug.print statement appears to work in other code locations? I am hoping someone may be able to provide some light on this strange error?
Image of the VB IDE debug.print Configuration Error:

Unhandled win32 exception occured in the application

I have an application in vb.net that I'm testing out in Windows 10 and I seem to be getting an error (Images below). This app works flawlessly in Windows 7, and it actually works without any issues in Windows 10, the problem is, when I exit the application is when I get the error.
The way it's structured, is if I run it from IDE, i first see a Login Windows where user logs in and then goes to MENU. If it's run in our environment, user does not have to log in, so the log in form never appears, it goes directly to MENU.
Everything works great, until I go to EXIT Application, where it gets all messy, this is the code from EXIT button...
Dim Answer as Integer
Answer = MsgBox("Are you sure you wish to Close the application ?", MsgBoxStyle.YesNo)
If answer = vbYes Then
End
End If
These are the errors I get:
First I get this error, clicking on CLOSE PROGRAM closes it completely, if I click debug I get the below windows....
With the 2nd error it shows that I actually have VS2010 and VS2012, and it lets me debug. The issue is, the source code is in TFS, and it just so happens that I can't access the TFS from my windows 10 machine, (only from Win 7). So I can't debug it. But is there a reason why this is happening only in windows 10?
I even went as far as doing Me.Close() before END to make srue that the form is closed. And again, it works fine in Win 7, but win 10 it gives me the same problems.
Using "End" to close a program can be problematic; the comments and answer to this SO question explain why that is. As for the second issue that popped up once using Application.Exit(), that is a simple case of your program referencing multiple assemblies that have function calls with the same name. In this case, both the explicitly imported Microsoft.Office.Interop.Excel and implicitly imported System.Windows.Forms have "Application.Exit()" members. Since you have explicitly imported Excel, the compiler goes with that one when it's forced to decide which Exit() to use, which throws an error because of the context it's being used and doesn't actually close the program. To rectify that, all you have to do is explicitly tell the compiler which Exit() you want to use by replacing
Application.Exit()
with
System.Windows.Forms.Application.Exit()

VB project doesn't enter in debug mode after change to release and back to debug

I have a project in VB VS2003 everything work fine until i change it to Release, compile and then back to Debug. Now i can run the project but it doesn't stop on any breakpoint, i had try on different machine and the result is the same, i have try with other project and everything work fine
<STAThread()> _
Public Shared Sub Main()
Dim splashWin As New Splash 'Here is one breakpoint and it never stop
splashWin.Show()
Application.DoEvents()
Note: If I press the break all(pause) button on VS it launch this error: "Unable to break execution. Please wait until the debuggee has finished loading, and try again." But the application is running fine

Stopping Excel Macro executution when pressing Esc won't work

I'm running excel 2007 on XP.
Is there a way to stop a macro from running during its execution other than pressing escape? Usually if I think I created an infinate loop or otherwise messed something up I hit escape and it throws an error but the macro stops.
This time (and I've done it before but not this badly), I set up a msgbox for some quick debugging. Turns out it had to loop about 6000 times, which made means I had to "OK" 6000 message boxes, which took several minutes. I didn't save before running (another mistake) so I couldn't open task manager to exit.
Is there another way to stop the execution of a macro in case I goof up like this again?
Use CRTL+BREAK to suspend execution at any point. You will be put into break mode and can press F5 to continue the execution or F8 to execute the code step-by-step in the visual debugger.
Of course this only works when there is no message box open, so if your VBA code constantly opens message boxes for some reason it will become a little tricky to press the keys at the right moment.
You can even edit most of the code while it is running.
Use Debug.Print to print out messages to the Immediate Window in the VBA editor, that's way more convenient than MsgBox.
Use breakpoints or the Stop keyword to automatically halt execution in interesting areas.
You can use Debug.Assert to halt execution conditionally.
CTRL + SCR LK (Scroll Lock) worked for me.
Sometimes, the right set of keys (Pause, Break or ScrLk) are not available on the keyboard (mostly happens with laptop users) and pressing Esc 2, 3 or multiple times doesn't halt the macro too.
I got stuck too and eventually found the solution in accessibility feature of Windows after which I tried all the researched options and 3 of them worked for me in 3 different scenarios.
Step #01: If your keyboard does not have a specific key, please do not worry and open the 'OnScreen Keyboard' from Windows Utilities by pressing Win + U.
Step #02: Now, try any of the below option and of them will definitely work depending on your system architecture i.e. OS and Office version
Ctrl + Pause
Ctrl + ScrLk
Esc + Esc (Press twice consecutively)
You will be put into break mode using the above key combinations as the macro suspends execution immediately finishing the current task. For eg. if it is pulling the data from web then it will halt immediately before execting any next command but after pulling the data, following which one can press F5 or F8 to continue the debugging.
You can stop a macro by pressing ctrl + break but if you don't have the break key you could use this autohotkey (open source) code:
+ESC:: SendInput
{CtrlBreak}
return
Pressing shift + Escape will be like pressing ctrl + break and thus will stop your macro.
All the glory to this page
I also like to use MsgBox for debugging, and I've run into this same issue more than once. Now I always add a Cancel button to the popup, and exit the macro if Cancel is pressed. Example code:
If MsgBox("Debug message", vbOKCancel, "Debugging") = vbCancel Then Exit Sub
You can also try pressing the "FN" or function key with the button "Break" or with the button "sys rq" - system request as this - must be pressed together and this stops any running macro
I've found that sometimes whem I open a second Excel window and run a macro on that second window, the execution of the first one stops. I don't know why it doesn't work all the time, but you may try.
ESC and CTRL-BREAK did not work for me just now.
But CTRL-ESC worked!?
No idea why, but I thought I would throw it out there in case it helps someone else.
(I had forgotten i = i + 1 in my loop...)
Just Keep pressing ESC key. It will stop the VBA. This methods works when you get infinite MsgBox s
I forgot to comment out a line with a MsgBox before executing my macro. Meaning I'd have to click OK over a hundred thousand times. The ESC key was just escaping the message box but not stopping the execution of the macro. Holding the ESC key continuously for a few seconds helped me stop the execution of the code.
My laptop did not have Break nor Scr Lock, so I somehow managed to make it work by pressing Ctrl + Function + Right Shift (to activate 'pause').