It is often found in the RELEASE version of the program, but the debug version is not found, or the bug can be reproduced on the PC that does not have the development environment. At this time, I really want to see the data in the program execution, so the author Want to write a program, you can use Trace programs in the Release version and unloaded development environments, now completed, and after using many friends, thank you for your support and help, and I wish you all a happy new year. ! When using Xtracemonitor.exe, a small window will appear (for displaying data), you need to output Trace to the program of the monitor window, please use the #include "xtrace.h" in the file header, then put the code TRACE is modified to XTrace, and if the header file is included, the TRACE macro can also be used in the console program, and it is output to the Output window to the VC debug environment. To demonstrate the TRACE of the bitmap, you can provide a device-free bit map class CSIMpleDIB, defined in file SimpleDib.h, can be loaded from the Bitmap file, or load it from the resource. If you want to remove these additional code when you issue a program, you don't have to delete the XTrace and #include "xtrace.h" statement, just define the NO_XTRACE macro in the engineering settings, so the Xtrace.h file is like an empty file. There is no additional code in the executable program. For details, please refer to the XTrace.htm file. Use sample code as follows: #include "stdafx.h"
#include "xtrace.h"
#include "simpleDib.h"
#include "resource.h"
INT _Tmain (int Argc, _tchar * argv [])
{
Xtrace ("% s / n", "hello!"); // Output text "Hello!"
Xtrace (RGB (255, 0, 0), "% S / N", "Red text."); // Output Red Text
XTrace (RGB (0, 0, 255), "% S / N", "Blue Text."); // Output Blue Text
CSIMPLEDIB DIB;
DIB.LOAD (IDB_bitmap_test);
Xtrace (Dib.getbitMapInfo (), DIB.GetBits ()); // Output DIB bitmap
Return 0;
}
When first use, please first perform Xtracemonitor.exe, then execute the program that needs to monitor output, there is no such request. Download Sample Source Code: http://www.nhvideo.net/codes/xtraceDemo.ra (ketales xtracemonitor.exe, xtrace.htm, simpledib.h).