bcamexception.cpp

来自「BCAM 1394 Driver」· C++ 代码 · 共 90 行

CPP
90
字号
//-----------------------------------------------------------------------------
//  Company:  Basler Vision Technologies
//  Section:  Vision Components
//  Project:  1394 Driver
//  $Header: BcamException.cpp, 7, 25.09.2003 12:41:41, Nebelung, H.$
//-----------------------------------------------------------------------------
/**
  \file     BcamException.cpp

  \brief   Implemention of class BcamException
*/
#include "stdafx.h"
#include "BcamError.h"
#include "BcamException.h"

using Bvc::ErrorNumber;
using Bvc::Exception;
using namespace Bcam;

const CString BcamException::m_LibraryFile = _T( "BcamError.dll" );

//------------------------------------------------------------------------------
// BcamException::BcamException( ErrorNumber e, CString context, va_list *pArgs): m_Error( e ), m_Description( "<no error message available>" ), m_Context( context )
// Author: 
//------------------------------------------------------------------------------
/**
* \brief Constructs a new object.
*
* \param     e The error code.
* \param     context The context string, describing the circumstances of the exception.
* \param     *pArgs Pointer to a list of arguments
*/
//------------------------------------------------------------------------------
BcamException::BcamException( ErrorNumber e,  CString context, va_list *pArgs)
: Exception( e, context, true )
{
  FormatMessage( m_LibraryFile, (char**)pArgs );
}

//------------------------------------------------------------------------------
// BcamException::BcamException( ErrorNumber e, CString context , PVOID pArg ) 
// Author: Hartmut Nebelung
//------------------------------------------------------------------------------
/**
* \overload
* \brief Constructs a new object
*
* \param     e The error code.
* \param     context The context string, describing the circumstances of the exception.
* \param     lpArgs Pointer to a single argument
*/
//------------------------------------------------------------------------------
BcamException::BcamException( ErrorNumber e, CString context , PVOID pArg  ) 
: Exception( e, context, true )
{
  FormatMessage( m_LibraryFile, (char**) pArg );
};



//------------------------------------------------------------------------------
// void BcamException::FormatMessage( const CString& LibraryFile, char** ppArgs )
// Author: 
// Date: 05.09.2002
//------------------------------------------------------------------------------
/**
 * <type function description here>
 *
 * \param     LibraryFile
 * \param     ppArgs
 * \return    
 *
 * <type Return description here>
 * 
 * \see       <delete line if not used>
 * \todo      
 */
//------------------------------------------------------------------------------
void BcamException::FormatMessage( const CString& LibraryFile, char** ppArgs )
{
  
  const WORD facility =  WORD( HIWORD( m_Error )  & 0xfff );

  if (facility == FACILITY_BCAM_DRIVER_ERROR)
  { // Clear custom code flag
    m_Error &= 0xdfffffff;
  }
  
  Exception::FormatMessage( LibraryFile, ppArgs );
}

⌨️ 快捷键说明

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