Click here to Skip to main content
15,921,905 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionParallel Question Pin
programmervb.netc++22-Jul-10 9:09
programmervb.netc++22-Jul-10 9:09 
AnswerRe: Parallel Question Pin
Dave Kreskowiak22-Jul-10 10:43
mveDave Kreskowiak22-Jul-10 10:43 
QuestionHow to catch all unhandled exceptions ? Pin
xx77abs22-Jul-10 0:11
xx77abs22-Jul-10 0:11 
AnswerRe: How to catch all unhandled exceptions ? Pin
xx77abs22-Jul-10 0:46
xx77abs22-Jul-10 0:46 
GeneralRe: How to catch all unhandled exceptions ? Pin
DaveAuld23-Jul-10 1:05
professionalDaveAuld23-Jul-10 1:05 
GeneralRe: How to catch all unhandled exceptions ? Pin
xx77abs24-Jul-10 5:20
xx77abs24-Jul-10 5:20 
AnswerRe: How to catch all unhandled exceptions ? Pin
Luc Pattyn24-Jul-10 7:07
sitebuilderLuc Pattyn24-Jul-10 7:07 
GeneralRe: How to catch all unhandled exceptions ? Pin
xx77abs24-Jul-10 7:11
xx77abs24-Jul-10 7:11 
In my last post I've told daveauld that I've turned strict on in my whole project Smile | :)

As for Application.ThreadException and Appdomain.UnhandledException, I know that they have different parameters, that's why I have overloaded ReportError sub, so that they booth can use it Wink | ;)

Like this:
Public Sub ReportError(ByVal sender As Object, ByVal e As System.Threading.ThreadExceptionEventArgs)
    Try
        MsgBox("Unhandled error has occured !!" & vbCrLf & vbCrLf & e.Exception.Message & vbCrLf & _ErrorTitle & " will now close.", _
               CType(MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, MsgBoxStyle), _ErrorTitle)
        WriteError(sender, e.Exception, "Yes")
        If Not System.Diagnostics.Debugger.IsAttached Then
            Application.Exit()
        End If
    Catch
    End Try
End Sub
Public Sub ReportError(ByVal sender As Object, ByVal e As System.UnhandledExceptionEventArgs)
    Try
        MsgBox("Unhandled error has occured !!" & vbCrLf & vbCrLf & CType(e.ExceptionObject, Exception).Message & vbCrLf & _ErrorTitle & " will now close.", _
               CType(MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, MsgBoxStyle), _ErrorTitle)
        WriteError(sender, CType(e.ExceptionObject, Exception), "No")
        If Not System.Diagnostics.Debugger.IsAttached Then
            Application.Exit()
        End If
    Catch
    End Try
End Sub


And I've told you, this is not working only in .NET Framework 3.5 (after creating HTTPWebRequest object) Wink | ;)
Right now I've switched my project to .NET Framework 4.0, and the same code is working perfectly
GeneralRe: How to catch all unhandled exceptions ? Pin
Luc Pattyn24-Jul-10 7:18
sitebuilderLuc Pattyn24-Jul-10 7:18 
GeneralRe: How to catch all unhandled exceptions ? Pin
xx77abs24-Jul-10 7:21
xx77abs24-Jul-10 7:21 
QuestionSend Null/Nothing to POS printer Pin
εїзεїзεїз20-Jul-10 21:48
εїзεїзεїз20-Jul-10 21:48 
AnswerRe: Send Null/Nothing to POS printer Pin
Steven J Jowett20-Jul-10 22:05
Steven J Jowett20-Jul-10 22:05 
GeneralRe: Send Null/Nothing to POS printer Pin
εїзεїзεїз20-Jul-10 22:16
εїзεїзεїз20-Jul-10 22:16 
GeneralRe: Send Null/Nothing to POS printer Pin
riced20-Jul-10 23:59
riced20-Jul-10 23:59 
GeneralRe: Send Null/Nothing to POS printer Pin
Steven J Jowett21-Jul-10 0:54
Steven J Jowett21-Jul-10 0:54 
GeneralRe: Send Null/Nothing to POS printer Pin
ChandraRam21-Jul-10 2:25
ChandraRam21-Jul-10 2:25 
AnswerRe: Send Null/Nothing to POS printer Pin
Luc Pattyn21-Jul-10 0:37
sitebuilderLuc Pattyn21-Jul-10 0:37 
GeneralRe: Send Null/Nothing to POS printer Pin
DaveAuld21-Jul-10 1:43
professionalDaveAuld21-Jul-10 1:43 
AnswerRe: Send Null/Nothing to POS printer Pin
AnnieMacD21-Jul-10 2:52
AnnieMacD21-Jul-10 2:52 
AnswerRe: Send Null/Nothing to POS printer Pin
melvintcs9-Dec-11 0:02
melvintcs9-Dec-11 0:02 
GeneralRe: Send Null/Nothing to POS printer Pin
εїзεїзεїз11-Dec-11 22:42
εїзεїзεїз11-Dec-11 22:42 
QuestionCommunication with Panasonic PABX phone [modified] Pin
FuzMic20-Jul-10 18:55
FuzMic20-Jul-10 18:55 
AnswerRe: Communication with Panasonic PABX phone Pin
DaveAuld22-Jul-10 9:02
professionalDaveAuld22-Jul-10 9:02 
GeneralRe: Communication with Panasonic PABX phone [modified] Pin
FuzMic22-Jul-10 17:55
FuzMic22-Jul-10 17:55 
QuestionCheckbox in datagridview Pin
waner michaud20-Jul-10 9:45
waner michaud20-Jul-10 9:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.