Click here to Skip to main content
15,895,084 members
Articles / Web Development / HTML

TraceTool 12.7: The Swiss-Army Knife of Trace

Rate me:
Please Sign up or sign in to vote.
4.97/5 (234 votes)
20 Nov 2016CPL19 min read 2M   39K   1K  
A C#, C++, Delphi, ActiveX , Javascript , NodeJs and Java trace framework and a trace viewer: Tail, OutputDebugString, event log, and with Log4J, Log4Net, and Microsoft Enterprise Instrumentation Framework (EIF) support. This also comes with full support for Pocket PC, Silverlight, and Android.
// Watches.cpp : implementation file
//

#include "stdafx.h"
#include "WinCeDemo.h"
#include "Watches.h"
#include "tracetool.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// Watches property page

IMPLEMENT_DYNCREATE(Watches, CPropertyPage)

Watches::Watches() : CPropertyPage(Watches::IDD)
{
	//{{AFX_DATA_INIT(Watches)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}

Watches::~Watches()
{
}

void Watches::DoDataExchange(CDataExchange* pDX)
{
	CPropertyPage::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(Watches)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(Watches, CPropertyPage)
	//{{AFX_MSG_MAP(Watches)
	ON_BN_CLICKED(IDC_CLEAR, OnClear)
	ON_BN_CLICKED(IDC_DISP, OnDisp)
	ON_BN_CLICKED(IDC_SEND, OnSend)
	ON_BN_CLICKED(IDC_WINWATCH_CLEAR, OnWinwatchClear)
	ON_BN_CLICKED(IDC_WINWATCH_DISPLAY, OnWinwatchDisplay)
	ON_BN_CLICKED(IDC_WINWATCH_SEND, OnWinwatchSend)
	ON_BN_CLICKED(IDC_WINWATCH_CREATE, OnWinwatchCreate)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// Watches message handlers

//----------------------------------------------------------------------

// send watch to main watch window
void Watches::OnSend() 
{
   TTrace::Watches()->Send ("test2" , TTrace::CreateTraceID()) ;	
}

//----------------------------------------------------------------------

// clear main watch window
void Watches::OnClear() 
{
   TTrace::Watches()->ClearAll() ;          	
}

//----------------------------------------------------------------------

// display main watch window
void Watches::OnDisp() 
{
   TTrace::Watches()->DisplayWin() ;          
}

//----------------------------------------------------------------------

// create a new watch window
WinWatch * MyWinWatch  = NULL ;

void Watches::OnWinwatchCreate() 
{
   if (MyWinWatch == NULL)
      MyWinWatch = new WinWatch ("MyWinWatchID" , "My watches") ;	
}

//----------------------------------------------------------------------

// send watch to the new wiwatch window
void Watches::OnWinwatchSend() 
{
   if (MyWinWatch == NULL)
      return ;

   SYSTEMTIME Time;
   char buffer [MAX_PATH] ;

   GetLocalTime(&Time);
   sprintf(buffer, "%02d:%02d:%02d:%03d", Time.wHour, Time.wMinute, Time.wSecond, Time.wMilliseconds); 

   MyWinWatch->Send ("Now" , buffer) ;
}

//----------------------------------------------------------------------

// clear the new watch window
void Watches::OnWinwatchClear() 
{
   if (MyWinWatch != NULL)
      MyWinWatch->ClearAll() ;          
}

//----------------------------------------------------------------------

// display the new watch window
void Watches::OnWinwatchDisplay() 
{
   if (MyWinWatch != NULL)
      MyWinWatch->DisplayWin() ;          	
}

//----------------------------------------------------------------------

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Common Public License Version 1.0 (CPL)


Written By
Architect
Belgium Belgium
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions