Click here to Skip to main content
15,884,933 members
Articles / Programming Languages / C++

Writing Win32 Apps with C++ only classes (part 3)

Rate me:
Please Sign up or sign in to vote.
4.76/5 (14 votes)
20 Jun 2004CPOL26 min read 68.8K   979   56  
C++ classes and wrappers to write W32 apps without MFC, ATL or other (part 3).
//Misc.cpp : miscellaneous
#include "stdafx.h"

#include "Misc.h"

namespace GE_{ namespace NUtil{

#ifdef _DEBUG
	GE_INLINE void STrace::operator() (LPCTSTR format, ...)
	{
		if(_filter < _Filter()) return;
		TCHAR s[1024]; memset(s,0,sizeof(s));
		int m = wsprintf(&s[0], "(%4u)", _filter);
		memset(&s[m],'.',sizeof(TCHAR)*_Deep());
		va_list params;
		int n = wvsprintf(&s[_Deep()+m], format, va_start(params, format));
		_RPT0(_CRT_WARN, &s[0]);
	}

	GE_INLINE void STrace::createmsg(const type_info& ti, LPVOID address)
	{
		operator()("Create %s @ %p\n", ti.name(), address);
	}

	GE_INLINE void STrace::deletemsg(const type_info& ti, LPVOID address)
	{
		operator()("Delete %s @ %p\n", ti.name(), address);
	}

#else
	GE_INLINE void STrace::operator() (LPCTSTR format, ...) {}
	GE_INLINE void STrace::createmsg(const type_info& ti, LPVOID address) {}
	GE_INLINE void STrace::deletemsg(const type_info& ti, LPVOID address) {}
#endif



}}

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 Code Project Open License (CPOL)


Written By
Architect
Italy Italy
Born and living in Milan (Italy), I'm an engineer in electronics actually working in the ICT department of an important oil/gas & energy company as responsible for planning and engineering of ICT infrastructures.
Interested in programming since the '70s, today I still define architectures for the ICT, deploying dedicated specific client application for engineering purposes, working with C++, MFC, STL, and recently also C# and D.

Comments and Discussions