VB and VBA Users Source Code: Create GPFs and Debug Apps on demand
[
Home
|
Contents
|
Search
|
Reply
| Previous | Next ]
VB/VBA Source Code
Create GPFs and Debug Apps on demand
By:
Andrew Baker
Email (spam proof):
Email the originator of this post
Date:
Wednesday, June 28, 2000
Hits:
469
Category:
Windows API
Article:
Private Declare Sub FatalExit Lib "kernel32" (ByVal code As Long) 'This sub transfers execution control to the debugger Sub GPFME() FatalExit 1 End Sub Alternatively Private Declare Sub FatalAppExit Lib "kernel32" Alias "FatalAppExitA" (ByVal uAction As Long, ByVal lpMessageText As String) 'This sub displays a message box then terminates the app. Sub GPFME2(sMessage as String) FatalAppExit 0, sMessage End Sub And Finally use the DebugBreak. This is useful if you compile your VB Projects with 'Create symbolic debug info' selected... Private Declare Sub DebugBreak Lib "kernel32" () Sub DebugMode() DebugBreak End Sub
Terms and Conditions
Support this site
Download a trial version of the Excel Workbook Rebuilder