|
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
/// ==========================================================================
// Name : CError.h
// Purpose : simple wrapper class for displaying error msgs
#ifndef ERROR_H
#define ERROR_H
#include <windows.h>
#include <tchar.h>
//defines
//
#define EMPTY_BUFFER { _T( '\0' ) }
#define END_OF_STRING _T( '\0' )
#define MAX_MSG 4096
#define LENGTH(A) (sizeof(A)/sizeof(A[0]))
// ==========================================================================
// class CError
//
// Purpose:
// This class displays (error) messages and holds a return-code
// ==========================================================================
class CError
{
public:
// Constructors
CError();
CError( UINT nMsg,
UINT nCap = 0,
UINT nIcon = MB_OK,
int nRetCode = ERROR_SUCCESS,
LPCTSTR pszArg = NULL);
// Operations
int ShowMessage();
int ShowMessage(LPCTSTR pszMsg,
LPCTSTR pszCaption,
UINT nIcon,
LPCTSTR pszArg );
int ShowHResultMessage(UINT nMsg,
UINT nCaption,
UINT nIcon,
HRESULT hr,
LPCTSTR pszArg);
int ShowFormattedMessage(LPCTSTR pszMsg,
LPCTSTR pszCaption,
UINT nIcon,
LPCTSTR pszArg );
// Data
int m_nRetCode;
private:
static TCHAR s_szProductName[MAX_PATH+1];
LPCTSTR m_pszArg;
UINT m_nCaption;
UINT m_nMessage;
UINT m_nIconType;
va_list *m_pArgs;
};
#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.
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
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.