README.md

December 5, 2022 ยท View on GitHub

Debug.Print...from an Exe

Description

Everyone knows how useful Debug.Print can be when debugging a program in the run time environment...but why not make these debug comments available from an executable.

Simply replace Debug.Print with the following, and then when your application is running as an executable you can use a debugger (such as DBMON.EXE, downloadable form MSDN) to see the debug comments as they occur:

More Info

Submitted On
ByDuncan Jones
LevelIntermediate
User Rating4.3 (13 globes from 3 users)
CompatibilityVB 4.0 (32-bit), VB 5.0, VB 6.0
CategoryWindows API Call/ Explanation
WorldVisual Basic
Archive File

API Declarations

Private Declare Sub OutputDebugString Lib "kernel32" Alias "OutputDebugStringA" (ByVal lpOutputString As String)
Private Declare Function IsDebuggerPresent Lib "kernel32" () As Long

Source Code

Private Sub DebugNote(ByVal DebugString As String)
If IsDebuggerPresent Then
 Call OutputDebugString(DebugString)
End If
End Sub