Global error handler

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rodrigo Juarez

    #1

    Global error handler

    Hi

    Microsoft Visual Studio 2005, Visual Basic and winforms application
    I need a global error handler, where should I put that.
    Any examples?

    TIA

    Rodrigo Juarez


  • RobinS

    #2
    Re: Global error handler

    Rodrigo,

    I'm not sure what you mean by global error handler. If you want to put one
    in that will catch any error not captured by a *local* Try/Catch structure,
    you can put one in ApplicationEven ts.

    Exceptions bubble up the call tree until they are handled (or they hit the
    top and blow up). The top of the tree is in ApplicationEven ts, where you
    can add an event handler for unhandled exceptions.

    To get to the ApplicationEven ts, double-click on "My Projects" to bring up
    project properties, then select the tab "Applicatio n", and click on the
    button "View Application Events".

    To see what events you can capture, pull down the left dropdown at the top
    and select "(MyApplica tion Events)". Then pull down the right dropdown at
    the top. The one you want is UnhandledExcept ion.

    There are also events for the application starting up and shutting down,
    etc.

    Is this what you're looking for?

    Robin S.
    Ts'i mahnu uterna ot twan ot geifur hingts uto.
    -----------------------------------------------
    "Rodrigo Juarez" <tiempotecnolog ia@newsgroup.no spamwrote in message
    news:OlMt3JdUHH A.1200@TK2MSFTN GP02.phx.gbl...
    Hi
    >
    Microsoft Visual Studio 2005, Visual Basic and winforms application
    I need a global error handler, where should I put that.
    Any examples?
    >
    TIA
    >
    Rodrigo Juarez
    >

    Comment

    • Rodrigo Juarez

      #3
      Re: Global error handler

      Yes! this is what I looking for

      "RobinS" <RobinS@NoSpam. yah.noneescribi รณ en el mensaje
      news:R6qdncGfau MEQEjYnZ2dnUVZ_ veinZ2d@comcast .com...
      Rodrigo,
      >
      I'm not sure what you mean by global error handler. If you want to put one
      in that will catch any error not captured by a *local* Try/Catch
      structure, you can put one in ApplicationEven ts.
      >
      Exceptions bubble up the call tree until they are handled (or they hit the
      top and blow up). The top of the tree is in ApplicationEven ts, where you
      can add an event handler for unhandled exceptions.
      >
      To get to the ApplicationEven ts, double-click on "My Projects" to bring up
      project properties, then select the tab "Applicatio n", and click on the
      button "View Application Events".
      >
      To see what events you can capture, pull down the left dropdown at the top
      and select "(MyApplica tion Events)". Then pull down the right dropdown at
      the top. The one you want is UnhandledExcept ion.
      >
      There are also events for the application starting up and shutting down,
      etc.
      >
      Is this what you're looking for?
      >
      Robin S.
      Ts'i mahnu uterna ot twan ot geifur hingts uto.
      -----------------------------------------------
      "Rodrigo Juarez" <tiempotecnolog ia@newsgroup.no spamwrote in message
      news:OlMt3JdUHH A.1200@TK2MSFTN GP02.phx.gbl...
      >Hi
      >>
      >Microsoft Visual Studio 2005, Visual Basic and winforms application
      >I need a global error handler, where should I put that.
      >Any examples?
      >>
      >TIA
      >>
      >Rodrigo Juarez
      >>
      >
      >

      Comment

      • Jeffrey Tan[MSFT]

        #4
        Re: Global error handler

        Hi Rodrigo,

        Glad to see your problem is resolved. Below is some more information:

        Actually, VB2005 UnhandledExcept ion encapsulates .Net Winform
        Application.Thr eadException. .Net provided 3 different types of global
        error handler for unhandled exceptions based on the application types.

        ..Net Winform -- Application.Thr eadException event
        ..Net Console -- AppDomain.Unhan dledException event
        Asp.net -- HttpApplication .Error event, which is defined in Global.asax as
        Application_Err or method.

        Please refer to the article below:
        "Unexpected Errors in Managed Applications"
        http://msdn.microsoft.com/msdnmag/issues/04/06/NET/

        Hope this helps.

        Best regards,
        Jeffrey Tan
        Microsoft Online Community Support
        =============== =============== =============== =====
        Get notification to my posts through email? Please refer to
        http://msdn.microsoft.com/subscripti...ult.aspx#notif
        ications.

        Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
        where an initial response from the community or a Microsoft Support
        Engineer within 1 business day is acceptable. Please note that each follow
        up response may take approximately 2 business days as the support
        professional working with you may need further investigation to reach the
        most efficient resolution. The offering is not appropriate for situations
        that require urgent, real-time or phone-based interactions or complex
        project analysis and dump analysis issues. Issues of this nature are best
        handled working with a dedicated Microsoft Support Engineer by contacting
        Microsoft Customer Support Services (CSS) at
        http://msdn.microsoft.com/subscripti...t/default.aspx.
        =============== =============== =============== =====
        This posting is provided "AS IS" with no warranties, and confers no rights.



        Comment

        Working...