cóż, codeSMART ma jedną opcję zainstalowania globalnego uchwytu w aplikacji Pierwsze wywołanie SetUnhandledExceptionFilter (win api) powinno zostać zainstalowane podczas ładowania głównego lub głównego formularza modułu podczas zamykania programu, więc wywołaj SetUnhandledExceptionFilter.
Kod jest trochę długo, więc skopiować metody nazwy y wywołań 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
Również tutaj jest Record deklaracje Struktura y API dla modułu
- 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
Take zmieniony że How to route the exe exception back to VB6 app?
+1 Chciałbym również bardzo chciałbym wiedzieć, jak to zrobić – MarkJ