⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 errorhandling.cpp

📁 AES, 即Advanced Encryption Standard高级加密标准模块, 它是目前国际上最先进的加密技术, 是基于DES之后的最新发布的高段加密标准. 该标准由美国NIST(Nation
💻 CPP
字号:
/*
 *  ErrorHandling.cpp
 *
 *  Copyright (C) 2007
 *  Paul E. Jones <paulej@arid.us>
 *  All Rights Reserved.
 *
 ******************************************************************************
 *  $Id: ErrorHandling.cpp,v 1.1 2007/05/14 10:41:43 paulej Exp $
 ******************************************************************************
 *
 *  This file defines various global error handling and reporting functions.
 *
 */

#include "stdafx.h"

/*
 * ReportError
 *
 * Report an error to the user
 */
void ReportError(	std::basic_string<TCHAR> message,
					DWORD reason)
{
    LPTSTR error_string;

    if (reason != ERROR_SUCCESS)
    {
        if (::FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
                    FORMAT_MESSAGE_FROM_SYSTEM,
                    NULL,
                    reason,
                    0,
                    (LPTSTR)&error_string,
                    0,
                    NULL) != 0)
        {
            LPTSTR p = _tcschr(error_string, _T('\r'));
            if(p != NULL)
            {
                *p = _T('\0');
            }

            message += _T(":\n");
            message += error_string;

            ::LocalFree(error_string);
        }
    }

    ::MessageBox(NULL,message.c_str(),_T("AES Crypt Error"), MB_OK);
}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -