Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cerrorhandler.h
#ifndef CERRORHANDLER_H__
#define CERRORHANDLER_H__ 1
#include "p6loader.h"
namespace P6EXAMPLES {
//
// This defines a private interface that will be used
// to initalize our error handler. The createInstance()
// method returns only interface pointers and this
// allows us to ask it for this interface. Once
// initialize() has been successfully called,
// queryInterface() is used to retrieve the
// p6IJSONErrorHandler interface.
//
interface IErrorHandlerInit : public P6R::p6ICom
{
P6COMMETHOD initialize( P6R::p6IConsole *pConsole ) = 0;
};
// {374110B0-7302-4C2C-B89E-57222F406872}
#define IF_IErrorHandlerInit {0x374110B0,0x7302,0x4C2C,{0xB8,0x9E,0x57,0x22,0x2F,0x40,0x68,0x72}}
//
class CErrorHandler : public IErrorHandlerInit, public P6R::p6IJSONErrorHandler
{
public:
//
// P6COM Helper macro declares p6ICom methods
// - queryInterface()
// - addref()
// - release()
// - createInstance() <- This is a static method
// used to create an instance
// of this component.
//
//
// IErrorHandlerInit methods
//
P6COMMETHOD initialize( P6R::p6IConsole *pConsole );
//
// p6IJSONErrorHandler methods
//
P6COMMETHOD warning( P6R::P6ERR errorCode, P6R::p6IJSONLocator* pObject );
P6COMMETHOD warningEx( P6R::P6ERR errorCode, P6R::p6IJSONLocator* pObject, const P6R::P6CHAR* pDisplay );
P6COMMETHOD error( P6R::P6ERR errorCode, P6R::p6IJSONLocator* pObject );
P6COMMETHOD errorEx( P6R::P6ERR errorCode, P6R::p6IJSONLocator* pObject, const P6R::P6CHAR* pDisplay );
P6COMMETHOD fatalError( P6R::P6ERR errorCode, P6R::p6IJSONLocator* pObject );
P6COMMETHOD fatalErrorEx( P6R::P6ERR errorCode, P6R::p6IJSONLocator* pObject, const P6R::P6CHAR* pDisplay );
CErrorHandler();
virtual ~CErrorHandler();
protected:
P6R::P6BOOL m_bInitialized;
P6R::P6UINT32 m_errorState;
};
} // namespace
#endif