Click here to Skip to main content
15,881,424 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.
// NodeOperations.cpp : implementation file
//

#include "stdafx.h"
#include "Win32Demo.h"
#include "NodeOperations.h"
#include ".\nodeoperations.h"

// NodeOperations dialog

IMPLEMENT_DYNAMIC(NodeOperations, CPropertyPage)
NodeOperations::NodeOperations()
	: CPropertyPage(IDD_NODEEX)    // NodeOperations::IDD
{
   start1 = NULL ;
   start2 = NULL ;
}

NodeOperations::~NodeOperations()
{
   if (start1 != NULL)
      delete start1 ;

   if (start2 != NULL)
      delete start2 ;
}

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


BEGIN_MESSAGE_MAP(NodeOperations, CPropertyPage)
   ON_BN_CLICKED(IDC_START1, OnBnClickedStart1)
   ON_BN_CLICKED(IDC_RESEND, OnBnClickedResend)
   ON_BN_CLICKED(IDC_SETSELECTED, OnBnClickedSetselected)
   ON_BN_CLICKED(IDC_START2, OnBnClickedStart2)
   ON_BN_CLICKED(IDC_APPEND, OnBnClickedAppend)
   ON_BN_CLICKED(IDC_SHOWNODE, OnBnClickedShownode)
END_MESSAGE_MAP()


// NodeOperations message handlers

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

// create a TraceNodeEx for the Resend and SetSelected demo
void NodeOperations::OnBnClickedStart1()
{
   if (start1 == NULL)
   {
      start1 = TTrace::Debug()->CreateChildEx("Start 1 ..") ;	
      start1->Send() ;
   }
}

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

// Resend the text part of a node
void NodeOperations::OnBnClickedResend()
{
   if (start1 == NULL)
       return ;
   
   char buffer [100] ;
   int col1  ;

   col1 = rand() ;
   sprintf (buffer,"Done %d", col1) ;
   start1->traceNode->Resend (NULL,buffer ) ;   // resend right part
}

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

// set the node a selected in the viewer
void NodeOperations::OnBnClickedSetselected()
{
    if (start1 == NULL)
       return ;

    start1->traceNode->SetSelected() ;   
}

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

// create a TraceNodeEx for the Append() and Show() demo
void NodeOperations::OnBnClickedStart2()
{
   if (start2 == NULL)
   {
      start2 = new TraceNodeEx () ;
      start2->iconIndex  = CST_ICO_CONTROL ;
      start2->leftMsg = "Start 2 .." ;
      start2->Send() ;
   }
}

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

// append text to a node
void NodeOperations::OnBnClickedAppend()
{
   if (start2 == NULL)
       return ;

   start2->traceNode->Append ("..Done") ;   // Append left part
}

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

// ensure the node is visible in the viewer
void NodeOperations::OnBnClickedShownode()
{
   if (start2 == NULL)
       return ;

   start2->traceNode->Show() ;   
}

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