unhandled-exception

I am having trouble with multiple chars and scanf_s() [duplicate]

白昼怎懂夜的黑 提交于 2019-12-04 05:29:11
问题 This question already has answers here : Reading a character with scanf_s (3 answers) Closed 8 months ago . I'm trying to use scanf_s() to read in multiple values but every time I run the program, I get Unhandled exception at 0x592AD6AC (msvcr120d.dll) in lab 2.exe: 0xC0000005: Access violation writing location 0x00000000. in a popup window. How do I fix this? float inTemp; char inUnit; char outUnit; printf("Please enter the starting temperature with its units and the units\nyou would like to

Exception User-Unhandled reported in VS Debugger when using Polly

陌路散爱 提交于 2019-12-04 04:45:00
问题 I'm using Polly to catch an exception while calling a Pittney Bowes Geocoder service. I'm using a g1client library that throws a MessageProcessingException. I've wrapped the call in a Polly network policy to retry the call up to 3 times if this exception is thrown, but Visual Studio insists that the exception is "User-Unhandled" What do I need to modify to make this exception be handled? I'm using Visual Studio 2017 community Edition and C# 4.6.1. try { var networkPolicy = Policy .Handle

Direct2D : Unhandled Exception In WM_RESIZE switch case

老子叫甜甜 提交于 2019-12-04 03:42:06
问题 I am creating a Simple Direct2D Application. Unfortunately it is giving an unhandled exception. The function where it is taking place: void DemoApp::OnResize(UINT width, UINT height) { if (m_pRenderTarget) <----|****The exception occurs here.....**** { // Note: This method can fail, but it's okay to ignore the // error here, because the error will be returned again // the next time EndDraw is called. m_pRenderTarget->Resize(D2D1::SizeU(width, height)); } } And the code snippet calling

Can Unhandled Exceptions in Child AppDomains be prevented from crashing the main process?

▼魔方 西西 提交于 2019-12-04 03:07:04
问题 I'm writing a small plugins library which uses app domains to isolate plugins using .Net framework 4.0. Hence the code that goes in each plugin is out of my control. When an unhandled exception is raised in one of the plugins, I have observed the results to be kind of a mixed bag. They are as follows. When the unhandled exception gets thrown in the plugin's main thread, the main pluggable app calling the plugin's execute method is able to catch and handle it cleanly. No problems there.

How to start activity from UncaughtExceptionHandler if this is main thread crashed?

你说的曾经没有我的故事 提交于 2019-12-03 14:41:19
I am trying to start an error-reporting activty if unhandled exception detected. The problem is with exceptions thrown from main thread. Is there any way to start an activity if main thread crashed? The approach I've seen used for error catching in an UncaughtExcpetionHandler is to write the crash data out to file and then start the error handling Activity when the application is restarted based on the existence of the crash data file. Depending on what you want your Activity to do, this might work for you. I think this is the wrong way to go about it. What you need to do is make sure you

Prevent outer exception from being discarded when thrown from BeginInvoke

◇◆丶佛笑我妖孽 提交于 2019-12-03 12:01:30
I have a handler for Application.ThreadException , but I'm finding that exceptions aren't always getting passed to it correctly. Specifically, if I throw an exception-with-inner-exception from a BeginInvoke callback, my ThreadException handler doesn't get the outer exception -- it only gets the inner exception. Example code: public Form1() { InitializeComponent(); Application.ThreadException += (sender, e) => MessageBox.Show(e.Exception.ToString()); } private void button1_Click(object sender, EventArgs e) { var inner = new Exception("Inner"); var outer = new Exception("Outer", inner); //throw

How to crash a process on Windows-7 without getting the WER dialog?

寵の児 提交于 2019-12-03 06:25:34
Is it possible to crash a regular user-mode process on Windows-7 without getting the Windows Error Reporting (WER) dialog? (When and if WER is normally enabled and no specific flags are applied.) Note: I'm not interested in disabling WER , I'm interested in crash scenarios where WER isn't launched although it should and Windows "silently" terminates an app. On Windows XP, it is pretty trivial to write a C or C++ application (in user mode) that messes up its own address space in such a way that when an Access Violation (or other unhandled Win32 Exception) is finally raised, Windows XP will just

How can I allow Task exceptions to propagate back to the UI thread?

无人久伴 提交于 2019-12-03 06:11:39
In TPL, if an exception is thrown by a Task , that exception is captured and stored in Task.Exception , and then follows all the rules on observed exceptions . If it's never observed, it's eventually rethrown on the finalizer thread and crashes the process. Is there a way to prevent the Task from catching that exception, and just letting it propagate instead? The Task I'm interested in would already be running on the UI thread (courtesy of TaskScheduler.FromCurrentSynchronizationContext ), and I want the exception to escape so it can be handled by my existing Application.ThreadException

C# User Defined Exception handling for Erroe from Dll get Exception was unhandled by user code

余生长醉 提交于 2019-12-03 00:51:40
问题 i am working with dynamic c# application that links all the classes into the main application from the Dll files that i create separately, in these files when i connect my dll file dynamically the error handlers want throw the errors by the connection as it used to be here is what i try to do i have a dll file with this coding and class on it class clsGlobles { public object dlststus = false; // dtabase file status public clsGlobles() { try { if (dlststus == true) { } else { throw new

Exception handling with multiple forms

梦想与她 提交于 2019-12-02 21:03:22
I'm seeing different behavior with exceptions being caught or not being caught when I am debugging vs. when I am running a compiled .exe. I have two forms (Form1 and Form2). Form1 has a button on it which instantiates and calls ShowDialog on Form2. Form2 has a button on it which intentionally produces a divide by zero error. When I'm debugging, the catch block in Form1 is hit. When I run the compiled .exe, it is NOT hit, and instead I get a message box that states, "Unhandled exception has occurred in your application. If you click continue, the application will ignore this error and attempt