Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6976159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:27:39+00:00 2026-05-27T17:27:39+00:00

I have an Exception Handling project in my application that can be called from

  • 0

I have an Exception Handling project in my application that can be called from anywhere to show the user there is a problem with with system. Everything works great when the call is made from somewhere in the UI as expected. When I make calls from no UI parts of the application everything freezes. I have the code wrapped in the thread safe calls and when stepping through they don’t require the Invoke call. Any help is greatly appreciated. Code below:

Inside the form

    void err_DispEvent(string text)
    {
        if (InvokeRequired)
        {
            Invoke(new Error.DisplayDelegate(err_DispEvent), new object [] {text});
        }
        else
        {
            this.Show();
        }        
    }

Call from the class

public void FaultError(string errorMsg)
    {
        FaultForm fform = new FaultForm(errorMsg, "Internal Fault");
        if (this.dispEvent != null)
        {
            dispEvent(errorMsg);
        }
    }

    public event DisplayDelegate DispEvent
    {
        add { dispEvent += value; }
        remove { dispEvent -= value; }
    }

    private event DisplayDelegate dispEvent;

    public delegate void DisplayDelegate(string text);

Sample of how the class is used in the application

ECDUExceptions.Error newError = ECDUExceptions.Error.getInstance();
newError.FaultError("Heater is not responding to function calls, it has been turned off");
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:27:40+00:00Added an answer on May 27, 2026 at 5:27 pm

    Some information when re-invoking methods:

    1. Use BeginInvoke(...) instead of Invoke(...) as this will not wait for the call to finish, and so won’t freeze the calling thread.

    2. Use an Action when re-invoking. So in your case, you could change your invocation to:

      BeginInvoke(new Action<string>(err_DispEvent), text);
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I actually have two questions regarding exception/error handling in the iPhone app that I
I have an ASP.NET Web Application project that used to target ASP.NET 2.0. I
How can I use exception handling in Rails? Currently I have done following. In
I prefer to have the exception handling logic further up in the call stack,
Most program languages have some kind of exception handling; some languages have return codes,
Does anyone have examples/tutorials of exception handling in R? The official documentation is very
I know two approaches to Exception handling, lets have a look at them. Contract
I am implementing exception handling for our BizTalk services, and have run into a
I have an exception handler . In my asp.net application. It’s written in Global.asax.
In fact I have Idea about the exception handling. But while facing the interview

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.