beh, codeSMART ha un'opzione installa l'handle globale sull'applicazione prima di chiamare a SetUnhandledExceptionFilter (win api) deve essere installato quando si carica il modulo principale o master quando si chiude il programma, quindi chiamare SetUnhandledExceptionFilter.
il codice è po 'lungo in modo da copiare metodi nomi y chiamate API
Public Sub InstallGlobalHandler()
On Error Resume Next
If Not lnFilterInstalled Then
Call SetUnhandledExceptionFilter(AddressOf GlobalExceptionHandler)
lnFilterInstalled = True
End If
End Sub
Public Sub UninstallGlobalExceptionHandler()
On Error Resume Next
If lnFilterInstalled Then
Call SetUnhandledExceptionFilter(0&)
lnFilterInstalled = False
End If
End Sub
Anche qui è dichiarazioni Struttura y API record per il modulo
- CopyMemory
- SetUnhandledExceptionFilter
- RaiseException
' Public enums
-EExceptionType
-EExceptionHandlerReturn
-Private Const EXCEPTION_MAXIMUM_PARAMETERS = 15
' Private record structure
-Private Type CONTEXT
'Structure that describes an exception.
-Private Type EXCEPTION_RECORD
'Structure that contains exception information that can be used by a debugger.
-Private Type EXCEPTION_DEBUG_INFO
-Private Type EXCEPTION_POINTERS
Prendere un rivisto che How to route the exe exception back to VB6 app?
fonte
2012-01-18 19:38:14
+1 Vorrei anche piacerebbe molto sapere come fare – MarkJ