Search Tools Links Login

Debug.Print...from an Exe

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:

Original Author: Duncan Jones

API Declarations

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


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

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 88 times


Visual Basic 6


No attachments for this post

Loading Comments ...


No comments have been added for this post.

You must be logged in to make a comment.