コード例 #1
0
/*===========================================================================
 *
 * Class CSrErrorHandler Method - void AddErrorV (Type, Code, SubCode, Level, pString, Args);
 *
 * Adds a new error to the end of the array.
 *
 *=========================================================================*/
void CSrErrorHandler::AddErrorV (const int Type, const int Code, const int SubCode,
				 const int Level, const SSCHAR* pString, va_list Args) {

	/* Free old errors as needed */
  if (m_NumRecords >= SR_MAX_ERRORS) DeleteHalf();

  m_pRecords[m_NumRecords] = new CSrError;
  ++m_NumRecords;

  if (m_MsgPrefix.IsEmpty()) {
    CSString Buffer(m_MsgPrefix);
    Buffer += pString;
    m_pRecords[m_NumRecords - 1]->CreateV(Type, Code, SubCode, Level, Buffer, Args);
  }
  else
    m_pRecords[m_NumRecords - 1]->CreateV(Type, Code, SubCode, Level, pString, Args);

	/* Output log message */
  SystemLog.ErrPrintf("*** %s ***", m_pRecords[m_NumRecords - 1]->GetErrorTypeString().c_str());
  SystemLog.ErrPrintf("               Code = %d (%d)", Code, SubCode);
  SystemLog.ErrPrintf("              Level = %s", m_pRecords[m_NumRecords - 1]->GetErrorLevelString().c_str());
  SystemLog.ErrPrintf("       User Message = %s", m_pRecords[m_NumRecords - 1]->GetErrorMessage());
  SystemLog.ErrPrintf("        Description = %s", m_pRecords[m_NumRecords - 1]->GetErrorString().c_str());

	/* Call any registered callback functions */
  DoCallbacks(m_pRecords[m_NumRecords - 1]);
 }
コード例 #2
0
ファイル: ListBoxCtrl.cpp プロジェクト: jjayne/nSIGHTS
void CListBoxCtrl::OnSelchange()
{
    if (multiSelection)
        {
            int numSel = GetSelCount();
            m_intValArray.AllocAndSetSize(numSel);
            GetSelItems(numSel, m_intValArray.tListData);
        }
    else
        (*m_pintVal) = GetCurSel();

    DoCallbacks();
}
コード例 #3
0
ファイル: ButtonCtrl.cpp プロジェクト: jjayne/nSIGHTS
void CButtonCtrl::OnButtopaCalcssed()
{
    DoCallbacks();
}