Desktop Functions: Smart Device Functions:
|
OutputDebugString (kernel32)
Sends a string to the debugger for display. C# Signature:
[DllImport("kernel32.dll")] VB.NET Signature:
<DllImport("kernel32.dll")> _ Or (as in VB 6)
Public Declare Sub OutputDebugString Lib "kernel32" Alias _ User-Defined Types:None. Notes:None. Tips & Tricks:Get DebugView here (http://www.sysinternals.com/Utilities/DebugView.html) to display the output of OutputDebugString. This C# example extends the OutputDebugString(...) with variable arguments:
public static void OutputDebugStringVarArg( Now run the function as follows: OutputDebugStringVarArg("It is {0} past {1}", new object[] {5,10 }); Get OutputDebugString function implementation that accepts variable number of arguments like printf here (http://www.go4expert.com/forums/showthread.php?t=871) Sample Code:1. Create a new C# windows console application project. 2. Add the following
using System.Runtime.InteropServices; below
using System.Text; 3. Add the following as the first statement of the main function.
OutputDebugString("OutputDebugString Successfully executed"); Now execute the program with DebugView Open Alternative Managed API:System.Diagnostics.Debug.WriteLine System.Diagnostics.Debugger.Log Please edit this page!Do you have...
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more). |
|