Click here to Skip to main content
15,885,767 members
Articles / Desktop Programming / MFC

Event Logging in Windows 2000

Rate me:
Please Sign up or sign in to vote.
4.72/5 (14 votes)
30 May 20028 min read 180.9K   3.3K   51  
Sample code for performing event logging that is accessible from Event Viewer
// MCCreator.h: interface for the MCCreator class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_MCCREATOR_H__EA8DD6A3_8742_400C_95F6_AB184238330A__INCLUDED_)
#define AFX_MCCREATOR_H__EA8DD6A3_8742_400C_95F6_AB184238330A__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <fstream.h>

class MCCreator  
{
public:
	MCCreator();
	virtual ~MCCreator();
	virtual CreateMC(CString szInFileName, UINT nCategory, UINT nEvent);
protected:
	virtual void CreateCategoryHeading(CString szInFileName);
	virtual void CreateCategory();
	virtual void CreateEOCategory();
	virtual void CreateEventHeading();
	virtual void CreateEvent();
	virtual void CreateEOF();
	CString m_szOut;
	ofstream m_OutStrm;

};

#endif // !defined(AFX_MCCREATOR_H__EA8DD6A3_8742_400C_95F6_AB184238330A__INCLUDED_)

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


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

Comments and Discussions