0

This is weird, maybe it's an option / setting in VS2010 ...

I am running my vb.net program and it is hitting a Critical error for which I have a MSGBOX message to display. However, it doesn't display it just terminates the program ... on the right of the screen there is an IntelliTrace Window and it says :

User Prompt: Displayed "Critical Error has occurred ....."

User Prompt: Clicked "OK" The user clicked the "OK" button in the MessageBox

BUT I DIDN'T !!!!

Gary Heath
  • 313
  • 1
  • 3
  • 15
  • That's a limitation in the MessageBox function. IntelliTrace simply recorded its return value. Which was MB_OK, there is no return code for "somebody destroyed my window without clicking a button". – Hans Passant Feb 20 '13 at 19:27
  • Sorry, I don't understand, why is the MsgBox Window not displaying ? What is "destroying" the Window ?!? – Gary Heath Feb 20 '13 at 19:32
  • I'd recommend you focus on why your program terminates unexpectedly instead. We cannot guess what "Critical error" might mean, seems it is critical enough to cause your program to abort and wiping out the message box as well. – Hans Passant Feb 20 '13 at 19:37
  • Sorry, I will follow up on this tomorrow, but in this instance it is critical because a Zip file is missing & this program is supposed to process what is inside the Zip file, it's a totally controlled Abort, which is why I am confused ... anyway, tomorrow, thank you for yor help so far ... – Gary Heath Feb 21 '13 at 00:23
  • OK, back to work ... I am definitely confused, this is my code : ` If File.Exists(myRARfile) Then ZipTest() Else MsgBox("ERROR - There Is No RAR File For The " + myLeague + " League For Session " + mySession + " - Aborting ...", vbCritical, "Critical Error Has Occurred !") MSWord.Quit() Exit Sub End If` I've rebooted overnight, so there is nothing hanging around, my Zip file is missing so I expect to get the MsgBox appear, but it doeasn't !!! – Gary Heath Feb 21 '13 at 07:28
  • Apologies, I cannot get the code to format ! – Gary Heath Feb 21 '13 at 07:30

1 Answers1

0

This was happening because I was closing the Form when I had finished validating the input, which meant that the program had no active window in which to display the MessageBox, so it just assumed OK & continued !!!

In future, I must remember to leave the Form open until all actions that may relate to it are complete !!!

Gary Heath
  • 313
  • 1
  • 3
  • 15