1

I am new to Visual Studio. I'm programming now, and when I started the program in Visual Studio's debugger, it went all OK. When I pressed a button, it focused my code and popped up a box (with an arrow pointing at the line that has the error) saying what's the error, but I unchecked the check that says Show this warning when [...]

It's basically a warning that pauses my program and shows error, but can be ignored by unchecking a checkbox.

Now I need it and I don't know how to recover it. In Tools -> Debug I have everything enabled

So the question is, how to recover that popup message?

EDIT

I got a screenshot from a similar error (I created this error to take a screenshot) error

The error looked like that, it wasn't that error.

Jehof
  • 34,674
  • 10
  • 123
  • 155
user2479365
  • 613
  • 1
  • 5
  • 12
  • Can you post a screenshot? – Jeremy Thompson Jul 15 '13 at 05:12
  • No, the problem is that I would like to take it but I can't find the way to make that message appear again. And I don't find anything similar in Google Images – user2479365 Jul 15 '13 at 05:13
  • I didn't explain correctly. The problem caused the message to appear, but with the **exactly same** code it won't appear anymore because of unchecking the check that makes the error don't appear – user2479365 Jul 15 '13 at 05:15

1 Answers1

7

The pop up you saw was probably an Exception that was later on handled by your code.
In Visual studio you can decide if you want to get a notification every time an exception is thrown (AKA First chance exception) or just when it is not handled.
In order to re-enable the message box, Open the Excetions window (Debug > Exceptions OR Ctrl D, E), and make sure that for Common Language Runtime Exceptions you have the checkboxes marked both for Thrown and for User-Unhandled

enter image description here

Avi Turner
  • 10,234
  • 7
  • 48
  • 75
  • Thanks, but my application still keeps on getting frozen and no error appears - http://puu.sh/3DdWG.png Also, I didn't change anything from the code – user2479365 Jul 15 '13 at 05:33
  • When your application is forzen, if you pause it, can you tell in what row the code is? Is it something that you would expect to take a while? – Avi Turner Jul 15 '13 at 05:35
  • The code is `InputSimulator.SimulateKeyPress(VirtualKeyCode.LBUTTON);` - but I remember that the popup said that problem was in globalKeyboardHook (I use [InputSimulator](inputsimulator.codeplex.com) and [globalKeyboardHook](www.codeproject.com/Articles/19004/A-Simple-C-Global-Low-Level-Keyboard-Hook)). I didn't understand it, and ignored the error thinking that it's not a problem. And no, a keypress shouldn't take sooooo long. – user2479365 Jul 15 '13 at 05:39
  • Is this also the location where you got the original error? It seems that those actions shouldn't take long, but on on the other hand Those wrappers are probably hooking to the OS message pump, which means it makes sense they are pretty busy, especially if you are using your keyboard... – Avi Turner Jul 15 '13 at 05:44
  • Yes, that's the line, and no, that actions are pretty fast, I used them in a few projects and they did their job very well. That's why I use them again – user2479365 Jul 15 '13 at 05:46
  • Did the original error message say something about "cross-thread operation not valid"? It seems that you are attempting to modify a label from a non GUI thread. In order to so you need to Invoke the action to the GUI thread. (The faulty line is 'lblStatus.Text = "if is running";') – Avi Turner Jul 15 '13 at 05:52
  • No. It said something about unhandled MTA callbacks. Also, the modify works correctly (label says "if is running"). BTW when app gets frozen, I hover over the button / checkbox and it **still** changes color. Problem is that I can't click / check the checkbox / button – user2479365 Jul 15 '13 at 05:56
  • If it changes color, as far as i can tell - your program is not stuck. Try putting a breakpoint in the click event. – Avi Turner Jul 15 '13 at 06:00
  • Well, it doesn't matter. I solved it by using user32.dll API (from [here](http://stackoverflow.com/questions/2416748/how-to-simulate-mouse-click-in-c)) instead of InputSimulator. Now it works perfectly!! – user2479365 Jul 15 '13 at 06:08