Click here to Skip to main content
15,880,427 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 1.9M   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 "Win32Demo.h"
#include "Watches.h"
#include ".\watches.h"


// Watches dialog

IMPLEMENT_DYNAMIC(Watches, CPropertyPage)
Watches::Watches()
	: CPropertyPage(Watches::IDD)
{
}

Watches::~Watches()
{
}

void Watches::DoDataExchange(CDataExchange* pDX)
{
	CPropertyPage::DoDataExchange(pDX);
}


BEGIN_MESSAGE_MAP(Watches, CPropertyPage)
   ON_BN_CLICKED(IDC_butWatch, OnBnClickedbutwatch)
   ON_BN_CLICKED(IDC_butClearWatchWindow, OnBnClickedbutclearwatchwindow)
   ON_BN_CLICKED(IDC_butCreateWinWatch, OnBnClickedbutcreatewinwatch)
   ON_BN_CLICKED(IDC_butWinWatchSend, OnBnClickedbutwinwatchsend)
   ON_BN_CLICKED(IDC_butWinWatchClear, OnBnClickedbutwinwatchclear)
   ON_BN_CLICKED(IDC_butWinWatchDisplay, OnBnClickedbutwinwatchdisplay)
   ON_BN_CLICKED(IDC_butDisplayWatchWindow, OnBnClickedbutdisplaywatchwindow)
END_MESSAGE_MAP()


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

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

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

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

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

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

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

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

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

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

// send watch to the new wiwatch window
void Watches::OnBnClickedbutwinwatchsend()
{
   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::OnBnClickedbutwinwatchclear()
{
   if (MyWinWatch != NULL)
      MyWinWatch->ClearAll() ;         
}

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

// display the new watch window
void Watches::OnBnClickedbutwinwatchdisplay()
{
   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