Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Like a Debug.Print - but from compiled code. Ever...
Author:
Duncan Jones
E-mail:
Click to e-mail author
Website:
http://www.merrioncomputing.com
Submitted:
3/29/2001
Version:
VB4
Compatibility:
VB4, VB5, VB6
Category:
Windows API
Views:
10738
Like a Debug.Print - but from compiled code. Everyone knows how useful Debug.Print is for debugging code - but it doesn't help if you need to debug what is happening in an executable. Some people put code that writes to a text file, or something - but this can lead to a lot of unneccessary code being run. Why not send your debug.print type comments out to a debugger (like DBMON.EXE, downloadable from http://msdn.microsoft.com) ...and if there's no debugger running, just skip over them...
Declarations:
Private Declare Sub OutputDebugString Lib "kernel32" Alias "OutputDebugStringA" (ByVal lpOutputString As String) Private Declare Function IsDebuggerPresent Lib "kernel32" () As Long
Code:
Private Sub DebugNote(ByVal DebugString As String) If IsDebuggerPresent Then Call OutputDebugString("This is a test") End If End Sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement