Add rayman2 source files
This commit is contained in:
18
Rayman_X/cpa/tempgrp/ERO/Src/ErO.cpp
Normal file
18
Rayman_X/cpa/tempgrp/ERO/Src/ErO.cpp
Normal file
@@ -0,0 +1,18 @@
|
||||
// Err.cpp : Defines the initialization routines for the DLL.
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#include "StdAfx.h"
|
||||
|
||||
|
||||
#undef CPA_WANTS_IMPORT
|
||||
#undef CPA_EXPORT
|
||||
#define CPA_WANTS_EXPORT
|
||||
#include "ERR_Err.hpp"
|
||||
#undef CPA_WANTS_EXPORT
|
||||
#define CPA_WANTS_IMPORT
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
10
Rayman_X/cpa/tempgrp/ERO/Src/ErO.def
Normal file
10
Rayman_X/cpa/tempgrp/ERO/Src/ErO.def
Normal file
@@ -0,0 +1,10 @@
|
||||
; Err.def : Declares the module parameters for the DLL.
|
||||
|
||||
LIBRARY
|
||||
|
||||
DESCRIPTION 'Err Windows Dynamic Link Library'
|
||||
|
||||
EXPORTS
|
||||
; Explicit exports can go here
|
||||
ERO_fn_vInitModule
|
||||
|
570
Rayman_X/cpa/tempgrp/ERO/Src/ErOReprt.cpp
Normal file
570
Rayman_X/cpa/tempgrp/ERO/Src/ErOReprt.cpp
Normal file
@@ -0,0 +1,570 @@
|
||||
// ErOReprt.cpp : implementation file
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "ErOReprt.hpp"
|
||||
|
||||
#include "ErO_Op.hpp"
|
||||
#include "ErOTeam.hpp"
|
||||
|
||||
#include <mapi.h>
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
extern HMODULE g_hModule;
|
||||
extern CString g_csModuleName;
|
||||
|
||||
HINSTANCE h_MAPI_DLL = NULL;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// ErrorOperator_DialogReport dialog
|
||||
|
||||
BEGIN_MESSAGE_MAP(ErrorOperator_DialogReport, CDialog)
|
||||
//{{AFX_MSG_MAP(ErrorOperator_DialogReport)
|
||||
ON_BN_CLICKED(IDC_BUTTON_FILE_BROWSE, OnButtonFileBrowse)
|
||||
ON_BN_CLICKED(IDC_RADIO_REPORT_CLIPBOARD, OnRadioReportClipboard)
|
||||
ON_BN_CLICKED(IDC_RADIO_REPORT_FILE, OnRadioReportFile)
|
||||
ON_BN_CLICKED(IDC_RADIO_REPORT_PRINTER, OnRadioReportPrinter)
|
||||
ON_BN_CLICKED(IDC_RADIO_REPORT_MAIL, OnRadioReportMail)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
//***************************************************************************
|
||||
ErrorOperator_DialogReport::ErrorOperator_DialogReport(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(IDD_DIALOG_REPORT, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(ErrorOperator_DialogReport)
|
||||
m_iChosenReportType = 3;
|
||||
m_csFileName = _T("");
|
||||
m_bSendToMainProgrammer = TRUE;
|
||||
m_bSendToSecondProgrammer = FALSE;
|
||||
m_bSendToResponsible = FALSE;
|
||||
m_bDeleteReport = FALSE;
|
||||
m_csAddedComments = _T("");
|
||||
//}}AFX_DATA_INIT
|
||||
|
||||
//Initializing file name
|
||||
char a_cBuffer[MAX_PATH];
|
||||
GetModuleFileName(g_hModule, a_cBuffer, MAX_PATH);
|
||||
m_csFileName = a_cBuffer;
|
||||
|
||||
short wIndex = m_csFileName.ReverseFind('\\');
|
||||
if ( wIndex != -1 )
|
||||
m_csFileName = m_csFileName.Left(wIndex + 1);
|
||||
|
||||
if ( g_csModuleName.IsEmpty() )
|
||||
m_csFileName += "Error_Report.txt";
|
||||
else
|
||||
{
|
||||
//Computes date
|
||||
SYSTEMTIME stSystemTime;
|
||||
::GetLocalTime(&stSystemTime);
|
||||
CTime cTime(stSystemTime);
|
||||
CString csDate = cTime.Format("_%b_%d");
|
||||
|
||||
CString csFileName = CString("Rprt_") + g_csModuleName + csDate + ".txt";
|
||||
|
||||
m_csFileName += csFileName;
|
||||
}
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
void ErrorOperator_DialogReport::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(ErrorOperator_DialogReport)
|
||||
DDX_Radio(pDX, IDC_RADIO_REPORT_FILE, m_iChosenReportType);
|
||||
DDX_Text(pDX, IDC_EDIT_FILE_NAME, m_csFileName);
|
||||
DDX_Check(pDX, IDC_CHECK_MAIN_PROGRAMMER, m_bSendToMainProgrammer);
|
||||
DDX_Check(pDX, IDC_CHECK_SECOND_PROGRAMMER, m_bSendToSecondProgrammer);
|
||||
DDX_Check(pDX, IDC_CHECK_RESPONSIBLE, m_bSendToResponsible);
|
||||
DDX_Check(pDX, IDC_CHECK_DELETE_FILE, m_bDeleteReport);
|
||||
DDX_Text(pDX, IDC_EDIT_USER_ADDS, m_csAddedComments);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// ErrorOperator_DialogReport message handlers
|
||||
|
||||
//***************************************************************************
|
||||
BOOL ErrorOperator_DialogReport::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
OnRadioReportMail();
|
||||
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// EXCEPTION: OCX Property Pages should return FALSE
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
void ErrorOperator_DialogReport::OnOK()
|
||||
{
|
||||
UpdateData(TRUE);
|
||||
|
||||
switch ( m_iChosenReportType )
|
||||
{
|
||||
case 0:
|
||||
m_pri_fn_vSaveFile();
|
||||
break;
|
||||
case 1:
|
||||
m_pri_fn_vPrint();
|
||||
break;
|
||||
case 2:
|
||||
m_pri_fn_vCopyToClipboard();
|
||||
break;
|
||||
case 3:
|
||||
m_pri_fn_vSendByMail();
|
||||
break;
|
||||
}
|
||||
|
||||
CDialog::OnOK();
|
||||
}
|
||||
|
||||
// Private Functions
|
||||
////////////////////////
|
||||
|
||||
//***************************************************************************
|
||||
void ErrorOperator_DialogReport::m_pri_fn_vSaveFile()
|
||||
{
|
||||
CStdioFile clFile;
|
||||
|
||||
const CString csSpacing = " ";
|
||||
const CString g_c_csUnknownn = "< Unknown >";
|
||||
const CString g_c_csNone = "< None >";
|
||||
|
||||
if ( clFile.Open(m_csFileName, CFile::modeReadWrite | CFile::modeCreate | CFile::modeNoTruncate | CFile::typeText) )
|
||||
{
|
||||
clFile.WriteString("##################################\n");
|
||||
clFile.WriteString("# Error Operator making a report #\n");
|
||||
clFile.WriteString("##################################\n");
|
||||
clFile.WriteString("\n");
|
||||
|
||||
//Computes date
|
||||
SYSTEMTIME stSystemTime;
|
||||
::GetLocalTime(&stSystemTime);
|
||||
CTime cTime(stSystemTime);
|
||||
CString csDate = cTime.Format("Date : %A, %B %d, %Y, %Hh%Mm \n");
|
||||
clFile.WriteString(csDate);
|
||||
clFile.WriteString("\n");
|
||||
|
||||
clFile.WriteString("Error has been detected in Module :\n");
|
||||
CString csCurrentLine = csSpacing + (g_csModuleName.IsEmpty() ? g_c_csUnknownn : g_csModuleName) + "\n";
|
||||
clFile.WriteString(csCurrentLine);
|
||||
|
||||
clFile.WriteString("Error level was :\n");
|
||||
switch ( g_eErrorGravity )
|
||||
{
|
||||
case E_ERROR_GRAVITY_WARNING:
|
||||
csCurrentLine = csSpacing + "Warning\n";
|
||||
break;
|
||||
case E_ERROR_GRAVITY_INSTABLE:
|
||||
csCurrentLine = csSpacing + "Instable\n";
|
||||
break;
|
||||
case E_ERROR_GRAVITY_FATAL:
|
||||
csCurrentLine = csSpacing + "Fatal\n";
|
||||
break;
|
||||
default:
|
||||
csCurrentLine = csSpacing + g_c_csUnknownn + "\n";
|
||||
break;
|
||||
}
|
||||
clFile.WriteString(csCurrentLine);
|
||||
|
||||
clFile.WriteString("\n");
|
||||
clFile.WriteString("Current action was :\n");
|
||||
csCurrentLine = csSpacing + (g_csCurrentAction.IsEmpty() ? g_c_csUnknownn : g_csCurrentAction) + "\n";
|
||||
clFile.WriteString(csCurrentLine);
|
||||
|
||||
clFile.WriteString("\n");
|
||||
clFile.WriteString("Calling function was :\n");
|
||||
csCurrentLine = csSpacing + (g_csCurrentFunction.IsEmpty() ? g_c_csUnknownn : g_csCurrentFunction) + "\n";
|
||||
clFile.WriteString(csCurrentLine);
|
||||
|
||||
clFile.WriteString("In source :\n");
|
||||
csCurrentLine = csSpacing + (g_csCurrentFileName.IsEmpty() ? g_c_csUnknownn : g_csCurrentFileName) + "\n";
|
||||
clFile.WriteString(csCurrentLine);
|
||||
|
||||
clFile.WriteString("At line :\n");
|
||||
csCurrentLine.Format("%i", g_wCurrentFileLine);
|
||||
csCurrentLine = csSpacing + (g_wCurrentFileLine < 0 ? g_c_csUnknownn : csCurrentLine) + "\n";
|
||||
clFile.WriteString(csCurrentLine);
|
||||
|
||||
clFile.WriteString("\n");
|
||||
clFile.WriteString("Additionnal informations were :\n");
|
||||
csCurrentLine = csSpacing + (g_csAddedInfo.IsEmpty() ? g_c_csNone : g_csAddedInfo) + "\n";
|
||||
clFile.WriteString(csCurrentLine);
|
||||
|
||||
clFile.WriteString("\n");
|
||||
clFile.WriteString("Script in progress :\n");
|
||||
csCurrentLine = csSpacing + (g_csCurrentScriptFileName.IsEmpty() ? g_c_csNone : g_csCurrentScriptFileName) + "\n";
|
||||
clFile.WriteString(csCurrentLine);
|
||||
|
||||
clFile.WriteString("At line :\n");
|
||||
csCurrentLine.Format("%i", g_wCurrentScriptLine);
|
||||
csCurrentLine = csSpacing + (g_wCurrentScriptLine <= 0 ? g_c_csUnknownn : csCurrentLine) + "\n";
|
||||
clFile.WriteString(csCurrentLine);
|
||||
|
||||
clFile.WriteString("\n");
|
||||
clFile.WriteString("----------------------------------------------------------------------\n");
|
||||
clFile.WriteString("\n");
|
||||
|
||||
clFile.Close();
|
||||
}
|
||||
else
|
||||
MessageBox("Error Operator cannot open the file to write its report !", "Error Operator - Error", MB_OK|MB_ICONSTOP);
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
void ErrorOperator_DialogReport::m_pri_fn_vPrint()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
void ErrorOperator_DialogReport::m_pri_fn_vCopyToClipboard()
|
||||
{
|
||||
const CString csSpacing = " ";
|
||||
const CString g_c_csUnknownn = "< Unknown >";
|
||||
const CString g_c_csNone = "< None >";
|
||||
CString csGlobalText;
|
||||
|
||||
csGlobalText += "##################################\n";
|
||||
csGlobalText += "# Error Operator making a report #\n";
|
||||
csGlobalText += "##################################\n";
|
||||
csGlobalText += "\n";
|
||||
|
||||
//Computes date
|
||||
SYSTEMTIME stSystemTime;
|
||||
::GetLocalTime(&stSystemTime);
|
||||
CTime cTime(stSystemTime);
|
||||
CString csDate = cTime.Format("Date : %A, %B %d, %Y, %Hh%Mm \n");
|
||||
csGlobalText += csDate;
|
||||
csGlobalText += "\n";
|
||||
|
||||
csGlobalText += "Error has been detected in Module :\n";
|
||||
CString csCurrentLine = csSpacing + (g_csModuleName.IsEmpty() ? g_c_csUnknownn : g_csModuleName) + "\n";
|
||||
csGlobalText += csCurrentLine;
|
||||
|
||||
csGlobalText += "Error level was :\n";
|
||||
switch ( g_eErrorGravity )
|
||||
{
|
||||
case E_ERROR_GRAVITY_WARNING:
|
||||
csCurrentLine = csSpacing + "Warning\n";
|
||||
break;
|
||||
case E_ERROR_GRAVITY_INSTABLE:
|
||||
csCurrentLine = csSpacing + "Instable\n";
|
||||
break;
|
||||
case E_ERROR_GRAVITY_FATAL:
|
||||
csCurrentLine = csSpacing + "Fatal\n";
|
||||
break;
|
||||
default:
|
||||
csCurrentLine = csSpacing + g_c_csUnknownn + "\n";
|
||||
break;
|
||||
}
|
||||
csGlobalText += csCurrentLine;
|
||||
|
||||
csGlobalText += "\n";
|
||||
csGlobalText += "Current action was :\n";
|
||||
csCurrentLine = csSpacing + (g_csCurrentAction.IsEmpty() ? g_c_csUnknownn : g_csCurrentAction) + "\n";
|
||||
csGlobalText += csCurrentLine;
|
||||
|
||||
csGlobalText += "\n";
|
||||
csGlobalText += "Calling function was :\n";
|
||||
csCurrentLine = csSpacing + (g_csCurrentFunction.IsEmpty() ? g_c_csUnknownn : g_csCurrentFunction) + "\n";
|
||||
csGlobalText += csCurrentLine;
|
||||
|
||||
csGlobalText += "In source :\n";
|
||||
csCurrentLine = csSpacing + (g_csCurrentFileName.IsEmpty() ? g_c_csUnknownn : g_csCurrentFileName) + "\n";
|
||||
csGlobalText += csCurrentLine;
|
||||
|
||||
csGlobalText += "At line :\n";
|
||||
csCurrentLine.Format("%i", g_wCurrentFileLine);
|
||||
csCurrentLine = csSpacing + (g_wCurrentFileLine < 0 ? g_c_csUnknownn : csCurrentLine) + "\n";
|
||||
csGlobalText += csCurrentLine;
|
||||
|
||||
csGlobalText += "\n";
|
||||
csGlobalText += "Additionnal informations were :\n";
|
||||
csCurrentLine = csSpacing + (g_csAddedInfo.IsEmpty() ? g_c_csNone : g_csAddedInfo) + "\n";
|
||||
csGlobalText += csCurrentLine;
|
||||
|
||||
csGlobalText += "\n";
|
||||
csGlobalText += "Script in progress :\n";
|
||||
csCurrentLine = csSpacing + (g_csCurrentScriptFileName.IsEmpty() ? g_c_csNone : g_csCurrentScriptFileName) + "\n";
|
||||
csGlobalText += csCurrentLine;
|
||||
|
||||
csGlobalText += "At line :\n";
|
||||
csCurrentLine.Format("%i", g_wCurrentScriptLine);
|
||||
csCurrentLine = csSpacing + (g_wCurrentScriptLine <= 0 ? g_c_csUnknownn : csCurrentLine) + "\n";
|
||||
csGlobalText += csCurrentLine;
|
||||
|
||||
csGlobalText += "\n";
|
||||
csGlobalText += "----------------------------------------------------------------------\n";
|
||||
csGlobalText += "\n";
|
||||
|
||||
m_pri_fn_vCopyIntoClipBoard(csGlobalText);
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
void ErrorOperator_DialogReport::OnButtonFileBrowse()
|
||||
{
|
||||
CFileDialog cfFileDial(TRUE);
|
||||
|
||||
if ( cfFileDial.DoModal() == IDOK )
|
||||
{
|
||||
m_csFileName = cfFileDial.GetPathName();
|
||||
|
||||
UpdateData(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
void ErrorOperator_DialogReport::OnRadioReportClipboard()
|
||||
{
|
||||
GetDlgItem(IDC_STATIC_FILE)->ShowWindow(SW_HIDE);
|
||||
GetDlgItem(IDC_EDIT_FILE_NAME)->ShowWindow(SW_HIDE);
|
||||
GetDlgItem(IDC_BUTTON_FILE_BROWSE)->ShowWindow(SW_HIDE);
|
||||
|
||||
GetDlgItem(IDC_CHECK_MAIN_PROGRAMMER)->ShowWindow(SW_HIDE);
|
||||
GetDlgItem(IDC_CHECK_SECOND_PROGRAMMER)->ShowWindow(SW_HIDE);
|
||||
GetDlgItem(IDC_CHECK_RESPONSIBLE)->ShowWindow(SW_HIDE);
|
||||
GetDlgItem(IDC_CHECK_DELETE_FILE)->ShowWindow(SW_HIDE);
|
||||
GetDlgItem(IDC_STATIC_ADD_COMMENTS)->ShowWindow(SW_HIDE);
|
||||
GetDlgItem(IDC_EDIT_USER_ADDS)->ShowWindow(SW_HIDE);
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
void ErrorOperator_DialogReport::OnRadioReportFile()
|
||||
{
|
||||
GetDlgItem(IDC_STATIC_FILE)->ShowWindow(SW_SHOW);
|
||||
GetDlgItem(IDC_EDIT_FILE_NAME)->ShowWindow(SW_SHOW);
|
||||
GetDlgItem(IDC_BUTTON_FILE_BROWSE)->ShowWindow(SW_SHOW);
|
||||
|
||||
GetDlgItem(IDC_CHECK_MAIN_PROGRAMMER)->ShowWindow(SW_HIDE);
|
||||
GetDlgItem(IDC_CHECK_SECOND_PROGRAMMER)->ShowWindow(SW_HIDE);
|
||||
GetDlgItem(IDC_CHECK_RESPONSIBLE)->ShowWindow(SW_HIDE);
|
||||
GetDlgItem(IDC_CHECK_DELETE_FILE)->ShowWindow(SW_HIDE);
|
||||
GetDlgItem(IDC_STATIC_ADD_COMMENTS)->ShowWindow(SW_HIDE);
|
||||
GetDlgItem(IDC_EDIT_USER_ADDS)->ShowWindow(SW_HIDE);
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
void ErrorOperator_DialogReport::OnRadioReportPrinter()
|
||||
{
|
||||
GetDlgItem(IDC_STATIC_FILE)->ShowWindow(SW_HIDE);
|
||||
GetDlgItem(IDC_EDIT_FILE_NAME)->ShowWindow(SW_HIDE);
|
||||
GetDlgItem(IDC_BUTTON_FILE_BROWSE)->ShowWindow(SW_HIDE);
|
||||
|
||||
GetDlgItem(IDC_CHECK_MAIN_PROGRAMMER)->ShowWindow(SW_HIDE);
|
||||
GetDlgItem(IDC_CHECK_SECOND_PROGRAMMER)->ShowWindow(SW_HIDE);
|
||||
GetDlgItem(IDC_CHECK_RESPONSIBLE)->ShowWindow(SW_HIDE);
|
||||
GetDlgItem(IDC_CHECK_DELETE_FILE)->ShowWindow(SW_HIDE);
|
||||
GetDlgItem(IDC_STATIC_ADD_COMMENTS)->ShowWindow(SW_HIDE);
|
||||
GetDlgItem(IDC_EDIT_USER_ADDS)->ShowWindow(SW_HIDE);
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
void ErrorOperator_DialogReport::OnRadioReportMail()
|
||||
{
|
||||
GetDlgItem(IDC_CHECK_MAIN_PROGRAMMER)->ShowWindow(SW_SHOW);
|
||||
GetDlgItem(IDC_CHECK_SECOND_PROGRAMMER)->ShowWindow(SW_SHOW);
|
||||
GetDlgItem(IDC_CHECK_RESPONSIBLE)->ShowWindow(SW_SHOW);
|
||||
GetDlgItem(IDC_CHECK_DELETE_FILE)->ShowWindow(SW_SHOW);
|
||||
GetDlgItem(IDC_STATIC_ADD_COMMENTS)->ShowWindow(SW_SHOW);
|
||||
GetDlgItem(IDC_EDIT_USER_ADDS)->ShowWindow(SW_SHOW);
|
||||
|
||||
GetDlgItem(IDC_STATIC_FILE)->ShowWindow(SW_HIDE);
|
||||
GetDlgItem(IDC_EDIT_FILE_NAME)->ShowWindow(SW_HIDE);
|
||||
GetDlgItem(IDC_BUTTON_FILE_BROWSE)->ShowWindow(SW_HIDE);
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
void ErrorOperator_DialogReport::m_pri_fn_vCopyIntoClipBoard(CString csText)
|
||||
{
|
||||
if( OpenClipboard() )
|
||||
{
|
||||
if( EmptyClipboard() )
|
||||
{
|
||||
long lSize=csText.GetLength();
|
||||
HANDLE hText=GlobalAlloc(GMEM_MOVEABLE|GMEM_DDESHARE,lSize+1);
|
||||
|
||||
if( hText != NULL )
|
||||
{
|
||||
LPVOID pvText=GlobalLock(hText);
|
||||
|
||||
if( pvText != NULL )
|
||||
{
|
||||
CopyMemory(pvText, LPCTSTR(csText), lSize+1);
|
||||
|
||||
HANDLE hRes = SetClipboardData(CF_TEXT, hText);
|
||||
|
||||
if( hRes == NULL )
|
||||
MessageBox("Can't set clipboard data");
|
||||
|
||||
GlobalUnlock(hText);
|
||||
}
|
||||
else
|
||||
MessageBox("Can't lock memory for clipboard operation");
|
||||
}
|
||||
else
|
||||
MessageBox("Can't alloc memory for clipboard");
|
||||
}
|
||||
else
|
||||
MessageBox("Can't empty clipboard");
|
||||
|
||||
CloseClipboard();
|
||||
}
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
void ErrorOperator_DialogReport::m_pri_fn_vSendByMail()
|
||||
{
|
||||
AfxGetApp()->DoWaitCursor(1);
|
||||
|
||||
if ( h_MAPI_DLL == NULL )
|
||||
{
|
||||
h_MAPI_DLL = LoadLibrary("MAPI32.dll");
|
||||
|
||||
if ( h_MAPI_DLL == NULL )
|
||||
MessageBox("No mail will be sent !", "ErO Module Error !!", MB_ICONSTOP);
|
||||
}
|
||||
|
||||
if ( h_MAPI_DLL != NULL )
|
||||
{
|
||||
// Get the addresses of all the API's supported by this object
|
||||
// m_MAPILogon = ( LPMAPILOGON ) GetProcAddress ( hlibMAPI, "MAPILogon" );
|
||||
// m_MAPISendDocuments = ( LPMAPISENDDOCUMENTS ) GetProcAddress ( hlibMAPI, "MAPISendDocuments" );
|
||||
// m_MAPIFindNext = ( LPMAPIFINDNEXT ) GetProcAddress ( hlibMAPI, "MAPIFindNext" );
|
||||
// m_MAPIReadMail = ( LPMAPIREADMAIL ) GetProcAddress ( hlibMAPI, "MAPIReadMail" );
|
||||
// m_MAPIAddress = ( LPMAPIADDRESS ) GetProcAddress ( hlibMAPI, "MAPIAddress" );
|
||||
// m_MAPILogoff = ( LPMAPILOGOFF ) GetProcAddress ( hlibMAPI, "MAPILogoff" );
|
||||
// m_MAPIFreeBuffer = ( LPMAPIFREEBUFFER ) GetProcAddress ( hlibMAPI, "MAPIFreeBuffer" );
|
||||
// m_MAPIDetails = ( LPMAPIDETAILS ) GetProcAddress ( hlibMAPI, "MAPIDetails" );
|
||||
// m_MAPISaveMail = ( LPMAPISAVEMAIL ) GetProcAddress ( hlibMAPI, "MAPISaveMail" );
|
||||
LPMAPIRESOLVENAME p_fn_MAPIResolveName = (LPMAPIRESOLVENAME)GetProcAddress(h_MAPI_DLL, "MAPIResolveName");
|
||||
LPMAPISENDMAIL p_fn_MAPISendMail = (LPMAPISENDMAIL)GetProcAddress(h_MAPI_DLL, "MAPISendMail");
|
||||
|
||||
//Builds Recipients list
|
||||
MapiRecipDesc RecipientArray[4];
|
||||
|
||||
char c_cI = 0;
|
||||
for (;c_cI < 4 ; c_cI ++)
|
||||
{
|
||||
RecipientArray[c_cI].ulReserved = 0L;
|
||||
RecipientArray[c_cI].ulEIDSize = 0L;
|
||||
RecipientArray[c_cI].lpEntryID = NULL;
|
||||
RecipientArray[c_cI].lpszAddress = NULL;
|
||||
}
|
||||
|
||||
c_cI = 0;
|
||||
//Gets Team
|
||||
ErrorOperator_Team *pclTeam = g_clListOfTeams.m_pub_fn_pclGetTeamFromModuleName(g_csModuleName);
|
||||
if ( pclTeam != NULL )
|
||||
{
|
||||
if ( m_bSendToMainProgrammer && (!pclTeam->m_csMainProgrammerName.IsEmpty()) )
|
||||
{
|
||||
//First recipient = MAIN PROGRAMMER
|
||||
RecipientArray[c_cI].ulRecipClass = MAPI_TO;
|
||||
RecipientArray[c_cI].lpszName = (char *)LPCTSTR(pclTeam->m_csMainProgrammerName);
|
||||
c_cI ++;
|
||||
}
|
||||
if ( m_bSendToSecondProgrammer && (!pclTeam->m_csSecondProgrammerName.IsEmpty()) )
|
||||
{
|
||||
//Second recipient = SECOND PROGRAMMER
|
||||
RecipientArray[c_cI].ulRecipClass = MAPI_TO;
|
||||
RecipientArray[c_cI].lpszName = (char *)LPCTSTR(pclTeam->m_csSecondProgrammerName);
|
||||
c_cI ++;
|
||||
}
|
||||
if ( m_bSendToResponsible && (!pclTeam->m_csResponsibleName.IsEmpty()) )
|
||||
{
|
||||
//Third recipient = SECOND PROGRAMMER
|
||||
RecipientArray[c_cI].ulRecipClass = MAPI_CC;
|
||||
RecipientArray[c_cI].lpszName = (char *)LPCTSTR(pclTeam->m_csResponsibleName);
|
||||
c_cI ++;
|
||||
}
|
||||
|
||||
//Fourth recipient = it's alaways me !!
|
||||
RecipientArray[c_cI].ulRecipClass = MAPI_BCC;
|
||||
RecipientArray[c_cI].lpszName = "Yves Babitch";
|
||||
c_cI ++;
|
||||
}
|
||||
|
||||
//Builds attachment
|
||||
//Saves file
|
||||
m_pri_fn_vSaveFile();
|
||||
MapiFileDesc attachment =
|
||||
{ 0, // ulReserved, must be 0
|
||||
0, // no flags; this is a data file
|
||||
(ULONG)-1, // position not specified
|
||||
(char *)LPCTSTR(m_csFileName), // pathname
|
||||
(char *)LPCTSTR(m_csFileName), // original filename
|
||||
NULL // MapiFileTagExt unused
|
||||
};
|
||||
|
||||
CString csSubject = "ErO Automatic Mail sender >>> The Module '" + g_csModuleName + "' has invoked ErO while '" + g_csCurrentAction + "'!";
|
||||
CString csText = "\nHere is the report on the Error raised in ErO.\n";
|
||||
if ( !m_csAddedComments.IsEmpty() )
|
||||
{
|
||||
csText += "The user wanted to add :\n";
|
||||
csText += m_csAddedComments;
|
||||
}
|
||||
|
||||
MapiMessage message =
|
||||
{ 0, // reserved, must be 0
|
||||
(char *)LPCTSTR(csSubject), //subject
|
||||
(char *)LPCTSTR(csText), //note text
|
||||
NULL, // NULL = interpersonal message
|
||||
NULL, // no date; MAPISendMail ignores it
|
||||
NULL, // no conversation ID
|
||||
0L, // no flags, MAPISendMail ignores it
|
||||
NULL, // no originator, this is ignored too
|
||||
c_cI, // Number of recipients
|
||||
RecipientArray, // NULL recipient array
|
||||
1, // one attachment
|
||||
&attachment // the attachment structure
|
||||
};
|
||||
|
||||
//Sends mail
|
||||
ULONG ulErrorCode;
|
||||
ulErrorCode = p_fn_MAPISendMail(0L, // use implicit session.
|
||||
0L, // ulUIParam; 0 is always valid
|
||||
&message, // the message being sent
|
||||
0L, // allow the user to edit the message
|
||||
0L); // reserved; must be 0
|
||||
|
||||
if ( ulErrorCode != SUCCESS_SUCCESS )
|
||||
{
|
||||
CString csMessage = "Unknown reason";
|
||||
switch ( ulErrorCode )
|
||||
{
|
||||
case MAPI_E_FAILURE:
|
||||
csMessage = "Messaging system internal failure";
|
||||
break;
|
||||
case MAPI_E_ATTACHMENT_NOT_FOUND:
|
||||
csMessage = "Attachment not found";
|
||||
break;
|
||||
case MAPI_E_ATTACHMENT_OPEN_FAILURE:
|
||||
csMessage = "Attachment could not be open";
|
||||
break;
|
||||
case MAPI_E_ATTACHMENT_WRITE_FAILURE:
|
||||
csMessage = "Attachment could not be written";
|
||||
break;
|
||||
};
|
||||
|
||||
csMessage = "Ero was unable to send the message : " + csMessage;
|
||||
MessageBox(csMessage, "ErO Module Error !!", MB_ICONEXCLAMATION);
|
||||
}
|
||||
|
||||
if ( m_bDeleteReport )
|
||||
{
|
||||
CFile cfFile;
|
||||
cfFile.Remove(m_csFileName);
|
||||
}
|
||||
}
|
||||
|
||||
AfxGetApp()->DoWaitCursor(-1);
|
||||
}
|
159
Rayman_X/cpa/tempgrp/ERO/Src/ErOTeam.cpp
Normal file
159
Rayman_X/cpa/tempgrp/ERO/Src/ErOTeam.cpp
Normal file
@@ -0,0 +1,159 @@
|
||||
// ErOTeam.cpp : implementation file
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "ErOTeam.hpp"
|
||||
|
||||
#include "ErO_Op.hpp"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
const CString g_c_csUnknownPerson = "< Unknown >";
|
||||
|
||||
//Programmers Info
|
||||
extern ErrorOperator_TeamList g_clListOfTeams;
|
||||
|
||||
//############################################################################
|
||||
//############################################################################
|
||||
//############################################################################
|
||||
|
||||
//***************************************************************************
|
||||
ErrorOperator_Team::ErrorOperator_Team( //Module
|
||||
CString _csModuleName,
|
||||
CString _csModuleVersion,
|
||||
|
||||
//Main Programmer
|
||||
CString _csMainProgrammerName,
|
||||
CString _csMainProgrammerPhoneNumber,
|
||||
CString _csMainProgrammerEMailAddress,
|
||||
|
||||
//Responsible
|
||||
CString _csResponsibleName,
|
||||
CString _csResponsiblePhoneNumber,
|
||||
CString _csResponsibleEMailAddress,
|
||||
|
||||
//Second Programmer
|
||||
CString _csSecondProgrammerName,
|
||||
CString _csSecondProgrammerPhoneNumber,
|
||||
CString _csSecondProgrammerEMailAddress
|
||||
)
|
||||
{
|
||||
//Module
|
||||
m_csModuleName = _csModuleName;
|
||||
m_csModuleVersion = _csModuleVersion;
|
||||
|
||||
//Main Programmer
|
||||
m_csMainProgrammerName = _csMainProgrammerName;
|
||||
m_csMainProgrammerPhoneNumber = _csMainProgrammerPhoneNumber;
|
||||
m_csMainProgrammerEMailAddress = _csMainProgrammerEMailAddress;
|
||||
|
||||
//Responsible
|
||||
m_csResponsibleName = _csResponsibleName;
|
||||
m_csResponsiblePhoneNumber = _csResponsiblePhoneNumber;
|
||||
m_csResponsibleEMailAddress = _csResponsibleEMailAddress;
|
||||
|
||||
//Second Programmer
|
||||
m_csSecondProgrammerName = _csSecondProgrammerName;
|
||||
m_csSecondProgrammerPhoneNumber = _csSecondProgrammerPhoneNumber;
|
||||
m_csSecondProgrammerEMailAddress = _csSecondProgrammerEMailAddress;
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
ErrorOperator_Team::~ErrorOperator_Team()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//############################################################################
|
||||
//############################################################################
|
||||
//############################################################################
|
||||
|
||||
//***************************************************************************
|
||||
ErrorOperator_TeamList::ErrorOperator_TeamList()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
ErrorOperator_TeamList::~ErrorOperator_TeamList()
|
||||
{
|
||||
m_pri_fn_vEmptyList();
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
ErrorOperator_Team *ErrorOperator_TeamList::m_pub_fn_pclAddTeam(//Module
|
||||
CString _csModuleName,
|
||||
CString _csModuleVersion,
|
||||
|
||||
//Main Programmer
|
||||
CString _csMainProgrammerName,
|
||||
CString _csMainProgrammerPhoneNumber,
|
||||
CString _csMainProgrammerEMailAddress,
|
||||
|
||||
//Responsible
|
||||
CString _csResponsibleName,
|
||||
CString _csResponsiblePhoneNumber,
|
||||
CString _csResponsibleEMailAddress,
|
||||
|
||||
//Second Programmer
|
||||
CString _csSecondProgrammerName,
|
||||
CString _csSecondProgrammerPhoneNumber,
|
||||
CString _csSecondProgrammerEMailAddress)
|
||||
{
|
||||
ErrorOperator_Team *pclNewTeam = new ErrorOperator_Team(//Module
|
||||
_csModuleName,
|
||||
_csModuleVersion,
|
||||
|
||||
//Main Programmer
|
||||
_csMainProgrammerName,
|
||||
_csMainProgrammerPhoneNumber,
|
||||
_csMainProgrammerEMailAddress,
|
||||
|
||||
//Responsible
|
||||
_csResponsibleName,
|
||||
_csResponsiblePhoneNumber,
|
||||
_csResponsibleEMailAddress,
|
||||
|
||||
//Second Programmer
|
||||
_csSecondProgrammerName,
|
||||
_csSecondProgrammerPhoneNumber,
|
||||
_csSecondProgrammerEMailAddress);
|
||||
AddTail(pclNewTeam);
|
||||
|
||||
return pclNewTeam;
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
void ErrorOperator_TeamList::m_pri_fn_vEmptyList()
|
||||
{
|
||||
POSITION pos = GetHeadPosition();
|
||||
while ( pos != NULL )
|
||||
delete ( GetNext(pos) );
|
||||
|
||||
RemoveAll();
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
ErrorOperator_Team *ErrorOperator_TeamList::m_pub_fn_pclGetTeamFromModuleName(CString _csModuleName)
|
||||
{
|
||||
BOOL bFound = FALSE;
|
||||
ErrorOperator_Team *pclCurrentTeam;
|
||||
|
||||
POSITION pos = GetHeadPosition();
|
||||
while ( (pos != NULL) && (!bFound) )
|
||||
{
|
||||
pclCurrentTeam = GetNext(pos);
|
||||
|
||||
bFound = ( pclCurrentTeam->m_csModuleName.CompareNoCase(_csModuleName) == 0 );
|
||||
}
|
||||
|
||||
if ( bFound )
|
||||
return pclCurrentTeam;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
293
Rayman_X/cpa/tempgrp/ERO/Src/ErO_DgEr.cpp
Normal file
293
Rayman_X/cpa/tempgrp/ERO/Src/ErO_DgEr.cpp
Normal file
@@ -0,0 +1,293 @@
|
||||
// EDACDgEr.cpp : implementation file
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "ErO_Op.hpp"
|
||||
#include "ErOTeam.hpp"
|
||||
#include "ErOReprt.hpp"
|
||||
#include "ErO_Priv.hpp"
|
||||
|
||||
#undef CPA_WANTS_IMPORT
|
||||
#undef CPA_EXPORT
|
||||
#define CPA_WANTS_EXPORT
|
||||
#include "ErO_DgEr.hpp"
|
||||
#undef CPA_WANTS_EXPORT
|
||||
#define CPA_WANTS_IMPORT
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
#define ERO_C_TimerID 1069
|
||||
#define ERO_C_TimerDelay 200
|
||||
|
||||
#include "ErO_Res.h"
|
||||
|
||||
extern HMODULE g_hModule;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// ERROR_Dialog_ErrorInformations dialog
|
||||
|
||||
BEGIN_MESSAGE_MAP(ERROR_Dialog_ErrorInformations, CDialog)
|
||||
//{{AFX_MSG_MAP(ERROR_Dialog_ErrorInformations)
|
||||
ON_BN_CLICKED(IDC_BUTTON_OPEN_SCRIPT, OnButtonOpenScript)
|
||||
ON_BN_CLICKED(IDC_BUTTON_OPEN_SOURCE, OnButtonOpenSource)
|
||||
ON_WM_TIMER()
|
||||
ON_WM_CLOSE()
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
//**********************************************************************************************
|
||||
ERROR_Dialog_ErrorInformations::ERROR_Dialog_ErrorInformations()
|
||||
: CDialog(IDD_DIALOG_ERROR, NULL)
|
||||
{
|
||||
//{{AFX_DATA_INIT(ERROR_Dialog_ErrorInformations)
|
||||
// NOTE: the ClassWizard will add member initialization here
|
||||
//}}AFX_DATA_INIT
|
||||
|
||||
m_hOldInstance = AfxGetResourceHandle();
|
||||
AfxSetResourceHandle( g_hModule );
|
||||
|
||||
m_csCurrentAction = g_csCurrentAction.IsEmpty() ? ERO_C_szUnknown : g_csCurrentAction;
|
||||
|
||||
CStringList clStringList;
|
||||
ErO_fn_vBuildStringListForInfos(g_csAddedInfo, &clStringList);
|
||||
if ( clStringList.GetCount() > 0 )
|
||||
m_csErrorMoreInfo = clStringList.GetHead();
|
||||
else
|
||||
m_csErrorMoreInfo = ERO_C_szUnknown;
|
||||
|
||||
m_csCurrentFileName = g_csCurrentFileName.IsEmpty() ? ERO_C_szUnknown : g_csCurrentFileName;
|
||||
m_csFunction = g_csCurrentFunction.IsEmpty() ? ERO_C_szUnknown : g_csCurrentFunction;
|
||||
|
||||
m_csCurrentScriptFileName = g_csCurrentScriptFileName.IsEmpty() ? ERO_C_szUnknown : g_csCurrentScriptFileName;
|
||||
|
||||
m_csErrorGravity = g_cslGravityMessages.GetAt(g_cslGravityMessages.FindIndex(g_eErrorGravity));
|
||||
|
||||
//Gets Bitmap
|
||||
UINT nIDResource = 0;
|
||||
switch ( g_eErrorGravity )
|
||||
{
|
||||
case E_ERROR_GRAVITY_FATAL:
|
||||
nIDResource = IDB_BITMAP_ERROR_FATAL;
|
||||
break;
|
||||
case E_ERROR_GRAVITY_INSTABLE:
|
||||
nIDResource = IDB_BITMAP_ERROR_INSTABLE;
|
||||
break;
|
||||
case E_ERROR_GRAVITY_WARNING:
|
||||
nIDResource = IDB_BITMAP_ERROR_WARNING;
|
||||
break;
|
||||
case E_ERROR_GRAVITY_UNKNOWN:
|
||||
nIDResource = IDB_BITMAP_ERROR_UNKNOWN;
|
||||
break;
|
||||
}
|
||||
|
||||
m_cbBitmap.LoadBitmap(nIDResource);
|
||||
|
||||
//Sets type of Statics
|
||||
m_clMIS_Module.m_pub_fn_vSetType(ERO_STATIC_TYPE__MODULE);
|
||||
m_clMIS_Action.m_pub_fn_vSetType(ERO_STATIC_TYPE__ACTION);
|
||||
m_clMIS_Debug.m_pub_fn_vSetType(ERO_STATIC_TYPE__DEBUG);
|
||||
m_clMIS_Script.m_pub_fn_vSetType(ERO_STATIC_TYPE__SCRIPT);
|
||||
m_clMIS_Additionnal.m_pub_fn_vSetType(ERO_STATIC_TYPE__ADDITIONNAL);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
ERROR_Dialog_ErrorInformations::~ERROR_Dialog_ErrorInformations()
|
||||
{
|
||||
AfxSetResourceHandle(m_hOldInstance);
|
||||
}
|
||||
|
||||
//**********************************************************************************************
|
||||
void ERROR_Dialog_ErrorInformations::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(ERROR_Dialog_ErrorInformations)
|
||||
DDX_Control(pDX, IDC_STATIC_MORE_ON_SCRIPT, m_clMIS_Script);
|
||||
DDX_Control(pDX, IDC_STATIC_MORE_ON_MODULE, m_clMIS_Module);
|
||||
DDX_Control(pDX, IDC_STATIC_MORE_ON_DEBUG, m_clMIS_Debug);
|
||||
DDX_Control(pDX, IDC_STATIC_MORE_ON_ADDITIONNAL, m_clMIS_Additionnal);
|
||||
DDX_Control(pDX, IDC_STATIC_MORE_ON_ACTION, m_clMIS_Action);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
//**********************************************************************************************
|
||||
BOOL ERROR_Dialog_ErrorInformations::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
//Loads bitmaps
|
||||
m_a_cbArrayOfBitmaps[7].LoadBitmap(IDB_PLUS_1);
|
||||
m_a_cbArrayOfBitmaps[6].LoadBitmap(IDB_PLUS_2);
|
||||
m_a_cbArrayOfBitmaps[5].LoadBitmap(IDB_PLUS_3);
|
||||
m_a_cbArrayOfBitmaps[4].LoadBitmap(IDB_PLUS_4);
|
||||
m_a_cbArrayOfBitmaps[3].LoadBitmap(IDB_PLUS_5);
|
||||
m_a_cbArrayOfBitmaps[2].LoadBitmap(IDB_PLUS_6);
|
||||
m_a_cbArrayOfBitmaps[1].LoadBitmap(IDB_PLUS_7);
|
||||
m_a_cbArrayOfBitmaps[0].LoadBitmap(IDB_PLUS_8);
|
||||
|
||||
SetTimer(ERO_C_TimerID, ERO_C_TimerDelay, NULL);
|
||||
|
||||
//Sets texts
|
||||
m_fn_vSetModuleText();
|
||||
m_fn_vSetCurrentActionText();
|
||||
m_fn_vSetCurrentFileNameText();
|
||||
m_fn_vSetFunctionText();
|
||||
m_fn_vSetCurrentScriptFileNameText();
|
||||
m_fn_vSetErrorGravityText();
|
||||
m_fn_vSetErrorMoreInfoText();
|
||||
|
||||
//Sets bitmap
|
||||
CStatic *pclBitmapStatic = (CStatic *)GetDlgItem(IDC_STATIC_IMAGE);
|
||||
pclBitmapStatic->SetBitmap(HBITMAP(m_cbBitmap));
|
||||
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// EXCEPTION: OCX Property Pages should return FALSE
|
||||
}
|
||||
|
||||
//**********************************************************************************************
|
||||
void ERROR_Dialog_ErrorInformations::OnClose()
|
||||
{
|
||||
KillTimer(ERO_C_TimerID);
|
||||
|
||||
CDialog::OnClose();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// ERROR_Dialog_ErrorInformations message handlers
|
||||
|
||||
//**********************************************************************************************
|
||||
void ERROR_Dialog_ErrorInformations::m_fn_vSetModuleText(CString csTextToDisplay)
|
||||
{
|
||||
CString csTrueModuleName = (g_csModuleName.IsEmpty()) ? ERO_C_szUnknown : g_csModuleName;
|
||||
|
||||
m_pri_fn_vSetTextToFitWindow(GetDlgItem(IDC_STATIC_MODULE_NAME), csTrueModuleName);
|
||||
}
|
||||
|
||||
//**********************************************************************************************
|
||||
void ERROR_Dialog_ErrorInformations::m_fn_vSetCurrentActionText(CString csTextToDisplay)
|
||||
{
|
||||
m_pri_fn_vSetTextToFitWindow(GetDlgItem(IDC_TEXT_CURRENT_ACTION),
|
||||
csTextToDisplay.IsEmpty() ? m_csCurrentAction : csTextToDisplay);
|
||||
}
|
||||
|
||||
//**********************************************************************************************
|
||||
void ERROR_Dialog_ErrorInformations::m_fn_vSetCurrentFileNameText(CString csTextToDisplay)
|
||||
{
|
||||
m_pri_fn_vSetTextToFitWindow(GetDlgItem(IDC_TEXT_FILE_NAME),
|
||||
csTextToDisplay.IsEmpty() ? m_pri_fn_csExtractFileNameFromCompletePath(m_csCurrentFileName) : csTextToDisplay);
|
||||
}
|
||||
|
||||
//**********************************************************************************************
|
||||
void ERROR_Dialog_ErrorInformations::m_fn_vSetFunctionText(CString csTextToDisplay)
|
||||
{
|
||||
m_pri_fn_vSetTextToFitWindow(GetDlgItem(IDC_TEXT_FUNCTION),
|
||||
csTextToDisplay.IsEmpty() ? m_csFunction : csTextToDisplay);
|
||||
}
|
||||
|
||||
//**********************************************************************************************
|
||||
void ERROR_Dialog_ErrorInformations::m_fn_vSetCurrentScriptFileNameText(CString csTextToDisplay)
|
||||
{
|
||||
m_pri_fn_vSetTextToFitWindow(GetDlgItem(IDC_TEXT_SCRIPT_FILE_NAME),
|
||||
csTextToDisplay.IsEmpty() ? m_pri_fn_csExtractFileNameFromCompletePath(m_csCurrentScriptFileName) : csTextToDisplay);
|
||||
|
||||
if ( m_csCurrentScriptFileName.Compare(ERO_C_szUnknown) == 0 )
|
||||
GetDlgItem(IDC_BUTTON_OPEN_SCRIPT)->EnableWindow(FALSE);
|
||||
}
|
||||
|
||||
//**********************************************************************************************
|
||||
void ERROR_Dialog_ErrorInformations::m_fn_vSetErrorGravityText(CString csTextToDisplay)
|
||||
{
|
||||
m_pri_fn_vSetTextToFitWindow(GetDlgItem(IDC_TEXT_ERROR_GRAVITY),
|
||||
csTextToDisplay.IsEmpty() ? m_csErrorGravity : csTextToDisplay);
|
||||
}
|
||||
|
||||
//**********************************************************************************************
|
||||
void ERROR_Dialog_ErrorInformations::m_fn_vSetErrorMoreInfoText(CString csTextToDisplay)
|
||||
{
|
||||
m_pri_fn_vSetTextToFitWindow(GetDlgItem(IDC_TEXT_ERROR_MORE_INFO),
|
||||
csTextToDisplay.IsEmpty() ? m_csErrorMoreInfo : csTextToDisplay);
|
||||
}
|
||||
|
||||
//**********************************************************************************************
|
||||
void ERROR_Dialog_ErrorInformations::OnButtonOpenScript()
|
||||
{
|
||||
CString csCommandLine = "Notepad.exe " + m_csCurrentScriptFileName;
|
||||
WinExec(csCommandLine, SW_SHOWNORMAL);
|
||||
}
|
||||
|
||||
//**********************************************************************************************
|
||||
void ERROR_Dialog_ErrorInformations::OnButtonOpenSource()
|
||||
{
|
||||
CString csCommandLine = "Notepad.exe " + m_csCurrentFileName;
|
||||
WinExec(csCommandLine, SW_SHOWNORMAL);
|
||||
}
|
||||
|
||||
//**********************************************************************************************
|
||||
CString ERROR_Dialog_ErrorInformations::m_pri_fn_csExtractFileNameFromCompletePath(CString _csCompletePath)
|
||||
{
|
||||
CString csStringToReturn;
|
||||
|
||||
short wIndex = _csCompletePath.ReverseFind('\\');
|
||||
if ( wIndex != -1 )
|
||||
csStringToReturn = _csCompletePath.Right(_csCompletePath.GetLength() - wIndex - 1);
|
||||
else
|
||||
csStringToReturn = _csCompletePath;
|
||||
|
||||
return csStringToReturn;
|
||||
}
|
||||
|
||||
//**********************************************************************************************
|
||||
void ERROR_Dialog_ErrorInformations::m_pri_fn_vSetTextToFitWindow(CWnd *_pclWnd, CString _csTextToDisplay)
|
||||
{
|
||||
//Gets window size
|
||||
CRect crWindowRect;
|
||||
_pclWnd->GetWindowRect(crWindowRect);
|
||||
|
||||
CString csDisplayedString = _csTextToDisplay;
|
||||
CString csTruelyDisplayedString;
|
||||
CClientDC dc(_pclWnd);
|
||||
dc.SelectObject(_pclWnd->GetFont());
|
||||
|
||||
if ( dc.GetTextExtent(csDisplayedString).cx > crWindowRect.Width() )
|
||||
{
|
||||
csTruelyDisplayedString = csDisplayedString + "...";
|
||||
|
||||
while ( dc.GetTextExtent(csTruelyDisplayedString).cx > crWindowRect.Width() )
|
||||
{
|
||||
csDisplayedString = csDisplayedString.Left(csDisplayedString.GetLength() - 1);
|
||||
csTruelyDisplayedString = csDisplayedString + "...";
|
||||
}
|
||||
|
||||
//Deletes one more character
|
||||
csDisplayedString = csDisplayedString.Left(csDisplayedString.GetLength() - 1);
|
||||
csTruelyDisplayedString = csDisplayedString + "...";
|
||||
|
||||
_pclWnd->SetWindowText(csTruelyDisplayedString);
|
||||
}
|
||||
else
|
||||
_pclWnd->SetWindowText(_csTextToDisplay);
|
||||
}
|
||||
|
||||
//**********************************************************************************************
|
||||
void ERROR_Dialog_ErrorInformations::OnTimer(UINT nIDEvent)
|
||||
{
|
||||
static char s_cCurrentBitmapIndex = 0;
|
||||
|
||||
if (nIDEvent == ERO_C_TimerID)
|
||||
{
|
||||
m_clMIS_Module.SetBitmap(HBITMAP(m_a_cbArrayOfBitmaps[s_cCurrentBitmapIndex]));
|
||||
m_clMIS_Action.SetBitmap(HBITMAP(m_a_cbArrayOfBitmaps[(s_cCurrentBitmapIndex + 1) % ERO_C_NUMBER_OF_BITMAPS]));
|
||||
m_clMIS_Debug.SetBitmap(HBITMAP(m_a_cbArrayOfBitmaps[(s_cCurrentBitmapIndex + 2) % ERO_C_NUMBER_OF_BITMAPS]));
|
||||
m_clMIS_Script.SetBitmap(HBITMAP(m_a_cbArrayOfBitmaps[(s_cCurrentBitmapIndex + 3) % ERO_C_NUMBER_OF_BITMAPS]));
|
||||
m_clMIS_Additionnal.SetBitmap(HBITMAP(m_a_cbArrayOfBitmaps[(s_cCurrentBitmapIndex + 4) % ERO_C_NUMBER_OF_BITMAPS]));
|
||||
|
||||
s_cCurrentBitmapIndex = (s_cCurrentBitmapIndex + 1) % ERO_C_NUMBER_OF_BITMAPS;
|
||||
}
|
||||
|
||||
CDialog::OnTimer(nIDEvent);
|
||||
}
|
||||
|
529
Rayman_X/cpa/tempgrp/ERO/Src/ErO_DgIf.cpp
Normal file
529
Rayman_X/cpa/tempgrp/ERO/Src/ErO_DgIf.cpp
Normal file
@@ -0,0 +1,529 @@
|
||||
// ErO_DgIf.cpp : implementation file
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "ErO_DgIf.hpp"
|
||||
|
||||
#include "ErO_Stat.hpp"
|
||||
#include "ErOTeam.hpp"
|
||||
#include "ErO_Op.hpp"
|
||||
#include "ErO_Priv.hpp"
|
||||
#include "ErOReprt.hpp"
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
//Array of ID
|
||||
UINT g_a_uiID[ERO_STATIC_TYPE__NUMBER_OF_TYPES - 1]=
|
||||
{
|
||||
IDD_DIALOG_MORE_INFO1,
|
||||
IDD_DIALOG_MORE_INFO2,
|
||||
IDD_DIALOG_MORE_INFO3,
|
||||
IDD_DIALOG_MORE_INFO4,
|
||||
IDD_DIALOG_MORE_INFO5,
|
||||
};
|
||||
/////////////////////////////////////////////////////////
|
||||
|
||||
#define ERO_C_SPACING_WITH_BORDER 14
|
||||
#define ERO_C_NUMBER_OF_BACKGROUND_BITMAPS 2
|
||||
|
||||
extern HMODULE g_hModule;
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// ErO_MoreInfoDialog dialog
|
||||
|
||||
BEGIN_MESSAGE_MAP(ErO_MoreInfoDialog, CDialog)
|
||||
//{{AFX_MSG_MAP(ErO_MoreInfoDialog)
|
||||
ON_WM_MOUSEMOVE()
|
||||
// ON_BN_CLICKED(IDC_BUTTON_SEND_MESSAGE, OnButtonSendMessage)
|
||||
ON_BN_CLICKED(IDC_BUTTON_MAKE_REPORT, OnButtonMakeReport)
|
||||
ON_WM_LBUTTONUP()
|
||||
ON_WM_LBUTTONDOWN()
|
||||
#ifdef ERO_BITMAP_AS_BACKGROUND
|
||||
ON_WM_PAINT()
|
||||
#endif //ERO_BITMAP_AS_BACKGROUND
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
//***************************************************************************
|
||||
ErO_MoreInfoDialog::ErO_MoreInfoDialog(CWnd* pParent,
|
||||
CPoint cpPoint,
|
||||
enum ErO_eStaticType _tdeType)
|
||||
: CDialog(g_a_uiID[_tdeType - 1], pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(ErO_MoreInfoDialog)
|
||||
// NOTE: the ClassWizard will add member initialization here
|
||||
//}}AFX_DATA_INIT
|
||||
|
||||
m_pri_cpPoint = cpPoint;
|
||||
m_pri_eType = _tdeType;
|
||||
|
||||
m_pri_bHasCapturedMouse= FALSE;
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
ErO_MoreInfoDialog::~ErO_MoreInfoDialog()
|
||||
{
|
||||
POSITION pos = m_pri_clListOfID.GetHeadPosition();
|
||||
while ( pos != NULL )
|
||||
delete m_pri_clListOfID.GetNext(pos);
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
void ErO_MoreInfoDialog::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(ErO_MoreInfoDialog)
|
||||
// NOTE: the ClassWizard will add DDX and DDV calls here
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// ErO_MoreInfoDialog message handlers
|
||||
|
||||
//***************************************************************************
|
||||
BOOL ErO_MoreInfoDialog::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
long lMaxLength = m_pri_fn_l_ComputeLongestString();
|
||||
|
||||
m_pri_BuilListOfID();
|
||||
m_pri_MoveControls(lMaxLength);
|
||||
|
||||
CRect crWindowRect;
|
||||
GetWindowRect(crWindowRect);
|
||||
//Moves Rect to right position
|
||||
crWindowRect.OffsetRect(m_pri_cpPoint.x - crWindowRect.left,
|
||||
m_pri_cpPoint.y - crWindowRect.top);
|
||||
|
||||
//Adjusts Rect's size
|
||||
crWindowRect.right = crWindowRect.left + lMaxLength + 2*ERO_C_SPACING_WITH_BORDER;
|
||||
|
||||
if ( m_pri_eType == ERO_STATIC_TYPE__MODULE )
|
||||
{
|
||||
//Gets Team
|
||||
ErrorOperator_Team *pclTeam = g_clListOfTeams.m_pub_fn_pclGetTeamFromModuleName(g_csModuleName);
|
||||
if ( pclTeam != NULL )
|
||||
{
|
||||
CString csProgName = pclTeam->m_csMainProgrammerName;
|
||||
csProgName.MakeLower();
|
||||
HICON hIcon;
|
||||
if ( csProgName.Find("babitch") != -1 )
|
||||
{
|
||||
hIcon = ::LoadIcon(g_hModule, MAKEINTRESOURCE(IDI_ICON_PROG_YB));
|
||||
((CStatic *)GetDlgItem(IDC_IMAGE))->SetIcon(hIcon);
|
||||
}
|
||||
else if ( csProgName.Find("billault") != -1 )
|
||||
{
|
||||
hIcon = ::LoadIcon(g_hModule, MAKEINTRESOURCE(IDI_ICON_PROG_XB));
|
||||
((CStatic *)GetDlgItem(IDC_IMAGE))->SetIcon(hIcon);
|
||||
}
|
||||
else if ( csProgName.Find("reizer") != -1 )
|
||||
{
|
||||
hIcon = ::LoadIcon(g_hModule, MAKEINTRESOURCE(IDI_ICON_PROG_DR));
|
||||
((CStatic *)GetDlgItem(IDC_IMAGE))->SetIcon(hIcon);
|
||||
}
|
||||
else
|
||||
GetDlgItem(IDC_IMAGE)->ShowWindow(SW_HIDE);
|
||||
}
|
||||
else
|
||||
{
|
||||
GetDlgItem(IDC_IMAGE)->ShowWindow(SW_HIDE);
|
||||
//Cannot send a message
|
||||
// GetDlgItem(IDC_BUTTON_SEND_MESSAGE)->ShowWindow(SW_HIDE);
|
||||
}
|
||||
}
|
||||
else if ( m_pri_eType == ERO_STATIC_TYPE__ACTION )
|
||||
{
|
||||
//Resizes window to show all lines of ListBox
|
||||
/* CListBox *pclListBox = (CListBox *)GetDlgItem(IDC_LIST_ADD_INFO);
|
||||
short wListBoxHeight = pclListBox->GetCount() * pclListBox->GetItemHeight(0) + 2;
|
||||
|
||||
CRect crLBRect;
|
||||
pclListBox->GetWindowRect(crLBRect);
|
||||
crLBRect.bottom = crLBRect.top + wListBoxHeight;
|
||||
|
||||
crWindowRect.bottom = crLBRect.bottom + ERO_C_SPACING_WITH_BORDER;
|
||||
|
||||
ScreenToClient(&crLBRect);
|
||||
|
||||
pclListBox->MoveWindow(crLBRect);*/
|
||||
}
|
||||
|
||||
//Moves Window
|
||||
MoveWindow(crWindowRect);
|
||||
|
||||
SetCapture();
|
||||
|
||||
#ifdef ERO_BITMAP_AS_BACKGROUND
|
||||
//Selects a bitmap
|
||||
/* srand((unsigned)time( NULL ));
|
||||
int iRandomNumber = rand();
|
||||
iRandomNumber = (iRandomNumber * ERO_C_NUMBER_OF_BACKGROUND_BITMAPS) / RAND_MAX + 1;
|
||||
CString csResourceName;
|
||||
csResourceName.Format("IDB_BITMAP_BACKGROUND_%i", iRandomNumber);
|
||||
m_pri_cBackgroundBitmap.LoadBitmap(csResourceName);*/
|
||||
m_pri_cBackgroundBitmap.LoadBitmap(IDB_BITMAP_BACKGROUND_1);
|
||||
#endif //ERO_BITMAP_AS_BACKGROUND
|
||||
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// EXCEPTION: OCX Property Pages should return FALSE
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
void ErO_MoreInfoDialog::OnMouseMove(UINT nFlags, CPoint point)
|
||||
{
|
||||
if ( !m_pri_bHasCapturedMouse )
|
||||
{
|
||||
SetCapture();
|
||||
|
||||
GetWindowRect(m_pri_crWindowRect);
|
||||
m_pri_bHasCapturedMouse = TRUE;
|
||||
}
|
||||
|
||||
if ( m_pri_bHasCapturedMouse )
|
||||
{
|
||||
CPoint cpTempPoint(point);
|
||||
ClientToScreen(&cpTempPoint);
|
||||
if ( !m_pri_crWindowRect.PtInRect(cpTempPoint) )
|
||||
{
|
||||
ReleaseCapture();
|
||||
m_pri_bHasCapturedMouse = FALSE;
|
||||
EndDialog(IDOK);
|
||||
}
|
||||
}
|
||||
|
||||
//For buttons response
|
||||
if ( m_pri_eType == ERO_STATIC_TYPE__MODULE )
|
||||
{
|
||||
WPARAM wParam = nFlags;
|
||||
LPARAM lParam = point.x << (sizeof(LPARAM) / 2) + point.y;
|
||||
|
||||
// GetDlgItem(IDC_BUTTON_SEND_MESSAGE)->SendMessage(WM_MOUSEMOVE, wParam, lParam);
|
||||
}
|
||||
|
||||
CDialog::OnMouseMove(nFlags, point);
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
void ErO_MoreInfoDialog::OnLButtonUp(UINT nFlags, CPoint point)
|
||||
{
|
||||
//For buttons response
|
||||
if ( m_pri_eType == ERO_STATIC_TYPE__MODULE )
|
||||
{
|
||||
WPARAM wParam = nFlags;
|
||||
LPARAM lParam = point.x << (sizeof(LPARAM) / 2) + point.y;
|
||||
|
||||
// GetDlgItem(IDC_BUTTON_SEND_MESSAGE)->SendMessage(WM_LBUTTONUP, wParam, lParam);
|
||||
}
|
||||
|
||||
CDialog::OnLButtonUp(nFlags, point);
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
void ErO_MoreInfoDialog::OnLButtonDown(UINT nFlags, CPoint point)
|
||||
{
|
||||
//For buttons response
|
||||
if ( m_pri_eType == ERO_STATIC_TYPE__MODULE )
|
||||
{
|
||||
WPARAM wParam = nFlags;
|
||||
LPARAM lParam = point.x << (sizeof(LPARAM) / 2) + point.y;
|
||||
|
||||
// GetDlgItem(IDC_BUTTON_SEND_MESSAGE)->SendMessage(WM_LBUTTONDOWN, wParam, lParam);
|
||||
}
|
||||
|
||||
CDialog::OnLButtonDown(nFlags, point);
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
/*void ErO_MoreInfoDialog::OnButtonSendMessage()
|
||||
{
|
||||
//Gets Team
|
||||
ErrorOperator_Team *pclTeam = g_clListOfTeams.m_pub_fn_pclGetTeamFromModuleName(g_csModuleName);
|
||||
if ( pclTeam != NULL )
|
||||
{
|
||||
CString csProgName = pclTeam->m_csMainProgrammerName;
|
||||
|
||||
//Builds a name with first name first letter and name
|
||||
short wIndex = csProgName.Find(" ");
|
||||
if ( wIndex != -1 )
|
||||
{
|
||||
CString csNetSendName = csProgName.Left(1) + csProgName.Right(csProgName.GetLength() - wIndex - 1);
|
||||
|
||||
CString csNetSendMessage = CString('"') + "Your module '" + g_csModuleName
|
||||
+ "' has crashed while : " + g_csCurrentAction + '"';
|
||||
|
||||
CString csCommanLine = "net send " + csNetSendName + " " + csNetSendMessage;
|
||||
WinExec(csCommanLine, SW_HIDE);
|
||||
}
|
||||
}
|
||||
} */
|
||||
|
||||
//***************************************************************************
|
||||
void ErO_MoreInfoDialog::OnButtonMakeReport()
|
||||
{
|
||||
ErrorOperator_DialogReport ReportDial(this);
|
||||
ReportDial.DoModal();
|
||||
SetCapture();
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
#define ERO_M_ADD_ID(ID) \
|
||||
pclUI = new UINT; \
|
||||
*pclUI = ID; \
|
||||
m_pri_clListOfID.AddTail(pclUI);
|
||||
|
||||
//***************************************************************************
|
||||
void ErO_MoreInfoDialog::m_pri_BuilListOfID()
|
||||
{
|
||||
UINT *pclUI;
|
||||
switch ( m_pri_eType )
|
||||
{
|
||||
case ERO_STATIC_TYPE__MODULE:
|
||||
ERO_M_ADD_ID(IDC_TEXT_TITLE);
|
||||
ERO_M_ADD_ID(IDC_MODULE_NAME);
|
||||
ERO_M_ADD_ID(IDC_MODULE_VERSION);
|
||||
ERO_M_ADD_ID(IDC_MODULE_MAIN_NAME);
|
||||
ERO_M_ADD_ID(IDC_MODULE_MAIN_PHONE);
|
||||
ERO_M_ADD_ID(IDC_MODULE_MAIN_MAIL);
|
||||
ERO_M_ADD_ID(IDC_MODULE_SECOND_NAME);
|
||||
ERO_M_ADD_ID(IDC_MODULE_SECOND_PHONE);
|
||||
ERO_M_ADD_ID(IDC_MODULE_SECOND_MAIL);
|
||||
ERO_M_ADD_ID(IDC_MODULE_RESPONSIBLE_NAME);
|
||||
ERO_M_ADD_ID(IDC_MODULE_RESPONSIBLE_PHONE);
|
||||
ERO_M_ADD_ID(IDC_MODULE_RESPONSIBLE_MAIL);
|
||||
break;
|
||||
|
||||
case ERO_STATIC_TYPE__ACTION:
|
||||
ERO_M_ADD_ID(IDC_TEXT_TITLE);
|
||||
ERO_M_ADD_ID(IDC_CURRENT_ACTION);
|
||||
ERO_M_ADD_ID(IDC_LIST_ADD_INFO);
|
||||
break;
|
||||
|
||||
case ERO_STATIC_TYPE__DEBUG:
|
||||
ERO_M_ADD_ID(IDC_TEXT_TITLE);
|
||||
ERO_M_ADD_ID(IDC_FILE_NAME);
|
||||
ERO_M_ADD_ID(IDC_LINE_NUMBER);
|
||||
ERO_M_ADD_ID(IDC_FILE_DATE);
|
||||
ERO_M_ADD_ID(IDC_FUNCTION);
|
||||
break;
|
||||
|
||||
case ERO_STATIC_TYPE__SCRIPT:
|
||||
ERO_M_ADD_ID(IDC_TEXT_TITLE);
|
||||
ERO_M_ADD_ID(IDC_FILE_NAME);
|
||||
ERO_M_ADD_ID(IDC_LINE_NUMBER);
|
||||
break;
|
||||
|
||||
case ERO_STATIC_TYPE__ADDITIONNAL:
|
||||
ERO_M_ADD_ID(IDC_TEXT_TITLE);
|
||||
ERO_M_ADD_ID(IDC_ERROR_TYPE);
|
||||
ERO_M_ADD_ID(IDC_EXPLANATION);
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
void ErO_MoreInfoDialog::m_pri_MoveControls(long _lWidth)
|
||||
{
|
||||
CWnd *pclWnd;
|
||||
CRect crControlRect;
|
||||
POSITION pos = m_pri_clListOfID.GetHeadPosition();
|
||||
while ( pos != NULL )
|
||||
{
|
||||
pclWnd = GetDlgItem(*m_pri_clListOfID.GetNext(pos));
|
||||
|
||||
if ( pclWnd != NULL )
|
||||
{
|
||||
pclWnd->GetWindowRect(crControlRect);
|
||||
ScreenToClient(crControlRect);
|
||||
crControlRect.right = crControlRect.left + _lWidth;
|
||||
|
||||
pclWnd->MoveWindow(crControlRect);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
long ErO_MoreInfoDialog::m_pri_fn_l_ComputeLongestString()
|
||||
{
|
||||
CClientDC dc(this);
|
||||
dc.SelectObject(GetFont());
|
||||
long lMaxLength = 0;
|
||||
CString csTempString;
|
||||
|
||||
//Gets Team
|
||||
ErrorOperator_Team *pclTeam = g_clListOfTeams.m_pub_fn_pclGetTeamFromModuleName(g_csModuleName);
|
||||
|
||||
switch ( m_pri_eType )
|
||||
{
|
||||
case ERO_STATIC_TYPE__MODULE:
|
||||
csTempString = "Module additionnal informations";
|
||||
lMaxLength = max(dc.GetTextExtent(csTempString).cx, lMaxLength);
|
||||
|
||||
csTempString = g_csModuleName.IsEmpty() ? ERO_C_szUnknown : g_csModuleName;
|
||||
lMaxLength = max(dc.GetTextExtent(csTempString).cx, lMaxLength);
|
||||
GetDlgItem(IDC_MODULE_NAME)->SetWindowText(csTempString);
|
||||
|
||||
csTempString = (pclTeam == NULL) ? ERO_C_szUnknown : pclTeam->m_csModuleVersion;
|
||||
lMaxLength = max(dc.GetTextExtent(csTempString).cx, lMaxLength);
|
||||
GetDlgItem(IDC_MODULE_VERSION)->SetWindowText(csTempString);
|
||||
|
||||
csTempString = (pclTeam == NULL) ? ERO_C_szUnknown : pclTeam->m_csMainProgrammerName;
|
||||
lMaxLength = max(dc.GetTextExtent(csTempString).cx, lMaxLength);
|
||||
GetDlgItem(IDC_MODULE_MAIN_NAME)->SetWindowText(csTempString);
|
||||
|
||||
csTempString = (pclTeam == NULL) ? ERO_C_szUnknown : pclTeam->m_csMainProgrammerPhoneNumber;
|
||||
lMaxLength = max(dc.GetTextExtent(csTempString).cx, lMaxLength);
|
||||
GetDlgItem(IDC_MODULE_MAIN_PHONE)->SetWindowText(csTempString);
|
||||
|
||||
csTempString = (pclTeam == NULL) ? ERO_C_szUnknown : pclTeam->m_csMainProgrammerEMailAddress;
|
||||
lMaxLength = max(dc.GetTextExtent(csTempString).cx, lMaxLength);
|
||||
GetDlgItem(IDC_MODULE_MAIN_MAIL)->SetWindowText(csTempString);
|
||||
|
||||
csTempString = (pclTeam == NULL) ? ERO_C_szUnknown : pclTeam->m_csResponsibleName;
|
||||
lMaxLength = max(dc.GetTextExtent(csTempString).cx, lMaxLength);
|
||||
GetDlgItem(IDC_MODULE_RESPONSIBLE_NAME)->SetWindowText(csTempString);
|
||||
|
||||
csTempString = (pclTeam == NULL) ? ERO_C_szUnknown : pclTeam->m_csResponsiblePhoneNumber;
|
||||
lMaxLength = max(dc.GetTextExtent(csTempString).cx, lMaxLength);
|
||||
GetDlgItem(IDC_MODULE_RESPONSIBLE_PHONE)->SetWindowText(csTempString);
|
||||
|
||||
csTempString = (pclTeam == NULL) ? ERO_C_szUnknown : pclTeam->m_csResponsibleEMailAddress;
|
||||
lMaxLength = max(dc.GetTextExtent(csTempString).cx, lMaxLength);
|
||||
GetDlgItem(IDC_MODULE_RESPONSIBLE_MAIL)->SetWindowText(csTempString);
|
||||
|
||||
csTempString = (pclTeam == NULL) ? ERO_C_szUnknown : pclTeam->m_csSecondProgrammerName;
|
||||
lMaxLength = max(dc.GetTextExtent(csTempString).cx, lMaxLength);
|
||||
GetDlgItem(IDC_MODULE_SECOND_NAME)->SetWindowText(csTempString);
|
||||
|
||||
csTempString = (pclTeam == NULL) ? ERO_C_szUnknown : pclTeam->m_csSecondProgrammerPhoneNumber;
|
||||
lMaxLength = max(dc.GetTextExtent(csTempString).cx, lMaxLength);
|
||||
GetDlgItem(IDC_MODULE_SECOND_PHONE)->SetWindowText(csTempString);
|
||||
|
||||
csTempString = (pclTeam == NULL) ? ERO_C_szUnknown : pclTeam->m_csSecondProgrammerEMailAddress;
|
||||
lMaxLength = max(dc.GetTextExtent(csTempString).cx, lMaxLength);
|
||||
GetDlgItem(IDC_MODULE_SECOND_MAIL)->SetWindowText(csTempString);
|
||||
|
||||
break;
|
||||
|
||||
case ERO_STATIC_TYPE__ACTION:
|
||||
{
|
||||
csTempString = "Current action additionnal informations";
|
||||
lMaxLength = max(dc.GetTextExtent(csTempString).cx, lMaxLength);
|
||||
|
||||
csTempString = g_csCurrentAction.IsEmpty() ? ERO_C_szUnknown : g_csCurrentAction;
|
||||
lMaxLength = max(dc.GetTextExtent(csTempString).cx, lMaxLength);
|
||||
GetDlgItem(IDC_CURRENT_ACTION)->SetWindowText(csTempString);
|
||||
|
||||
//Fills list box with strings
|
||||
CStringList clStringList;
|
||||
ErO_fn_vBuildStringListForInfos(g_csAddedInfo, &clStringList);
|
||||
POSITION pos = clStringList.GetHeadPosition();
|
||||
while (pos != NULL )
|
||||
{
|
||||
csTempString = clStringList.GetNext(pos);
|
||||
lMaxLength = max(dc.GetTextExtent(csTempString).cx, lMaxLength);
|
||||
((CListBox *)GetDlgItem(IDC_LIST_ADD_INFO))->AddString(csTempString);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case ERO_STATIC_TYPE__DEBUG:
|
||||
csTempString = "Debug additionnal informations";
|
||||
lMaxLength = max(dc.GetTextExtent(csTempString).cx, lMaxLength);
|
||||
|
||||
csTempString = g_csCurrentFileName;
|
||||
lMaxLength = max(dc.GetTextExtent(csTempString).cx, lMaxLength);
|
||||
GetDlgItem(IDC_FILE_NAME)->SetWindowText(csTempString);
|
||||
|
||||
csTempString.Format("%i", g_wCurrentFileLine);
|
||||
lMaxLength = max(dc.GetTextExtent(csTempString).cx, lMaxLength);
|
||||
GetDlgItem(IDC_LINE_NUMBER)->SetWindowText(csTempString);
|
||||
|
||||
csTempString = g_csLastModif;
|
||||
lMaxLength = max(dc.GetTextExtent(csTempString).cx, lMaxLength);
|
||||
GetDlgItem(IDC_FILE_DATE)->SetWindowText(csTempString);
|
||||
|
||||
csTempString = g_csCurrentFunction.IsEmpty() ? ERO_C_szUnknown : g_csCurrentFunction;
|
||||
lMaxLength = max(dc.GetTextExtent(csTempString).cx, lMaxLength);
|
||||
GetDlgItem(IDC_FUNCTION)->SetWindowText(csTempString);
|
||||
|
||||
break;
|
||||
|
||||
case ERO_STATIC_TYPE__SCRIPT:
|
||||
csTempString = "Script additionnal informations";
|
||||
lMaxLength = max(dc.GetTextExtent(csTempString).cx, lMaxLength);
|
||||
|
||||
csTempString = g_csCurrentScriptFileName.IsEmpty() ? ERO_C_szUnknown : g_csCurrentScriptFileName;
|
||||
lMaxLength = max(dc.GetTextExtent(csTempString).cx, lMaxLength);
|
||||
GetDlgItem(IDC_FILE_NAME)->SetWindowText(csTempString);
|
||||
|
||||
if ( !g_csCurrentScriptFileName.IsEmpty() )
|
||||
csTempString.Format("%i", g_wCurrentScriptLine);
|
||||
lMaxLength = max(dc.GetTextExtent(csTempString).cx, lMaxLength);
|
||||
GetDlgItem(IDC_LINE_NUMBER)->SetWindowText(csTempString);
|
||||
|
||||
break;
|
||||
|
||||
case ERO_STATIC_TYPE__ADDITIONNAL:
|
||||
csTempString = "Global informations";
|
||||
lMaxLength = max(dc.GetTextExtent(csTempString).cx, lMaxLength);
|
||||
|
||||
csTempString = g_cslGravityMessages.GetAt(g_cslGravityMessages.FindIndex(g_eErrorGravity));
|
||||
lMaxLength = max(dc.GetTextExtent(csTempString).cx, lMaxLength);
|
||||
GetDlgItem(IDC_ERROR_TYPE)->SetWindowText(csTempString);
|
||||
|
||||
csTempString = g_cslGravityExplanations.GetAt(g_cslGravityExplanations.FindIndex(g_eErrorGravity));
|
||||
lMaxLength = max(dc.GetTextExtent(csTempString).cx, lMaxLength);
|
||||
GetDlgItem(IDC_EXPLANATION)->SetWindowText(csTempString);
|
||||
|
||||
break;
|
||||
};
|
||||
|
||||
return lMaxLength + 10;
|
||||
}
|
||||
|
||||
#ifdef ERO_BITMAP_AS_BACKGROUND
|
||||
//***************************************************************************
|
||||
void ErO_MoreInfoDialog::OnPaint()
|
||||
{
|
||||
CPaintDC dc(this); // device context for painting
|
||||
|
||||
//Displays BackGround bitmap
|
||||
CDC pdc;
|
||||
pdc.CreateCompatibleDC(&dc);
|
||||
pdc.SelectObject(m_pri_cBackgroundBitmap);
|
||||
|
||||
//Gets Bitmap Size
|
||||
short wBitmapHeight, wBitmapWidth;
|
||||
wBitmapHeight = wBitmapWidth = 160;
|
||||
CRect crClientRect;
|
||||
GetClientRect(crClientRect);
|
||||
char cXTileNumber = crClientRect.Width() / wBitmapWidth + 1;
|
||||
char cYTileNumber = crClientRect.Height() / wBitmapHeight + 1;
|
||||
char cXC, cYC;
|
||||
|
||||
for (cXC = 0; cXC < cXTileNumber; cXC ++)
|
||||
{
|
||||
for (cYC = 0; cYC < cYTileNumber; cYC ++)
|
||||
{
|
||||
//Tiles Bitmap
|
||||
dc.BitBlt(cXC * wBitmapWidth,
|
||||
cYC * wBitmapHeight,
|
||||
wBitmapHeight, wBitmapWidth,
|
||||
&pdc,
|
||||
0, 0,
|
||||
SRCCOPY);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Do not call CDialog::OnPaint() for painting messages
|
||||
}
|
||||
#endif //ERO_BITMAP_AS_BACKGROUND
|
171
Rayman_X/cpa/tempgrp/ERO/Src/ErO_Op.cpp
Normal file
171
Rayman_X/cpa/tempgrp/ERO/Src/ErO_Op.cpp
Normal file
@@ -0,0 +1,171 @@
|
||||
// Error Operator
|
||||
//
|
||||
// Defined by YB
|
||||
//////////////////////////
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "ErOTeam.hpp"
|
||||
|
||||
#undef CPA_WANTS_IMPORT
|
||||
#undef CPA_EXPORT
|
||||
#define CPA_WANTS_EXPORT
|
||||
#include "ErO_Err.hpp"
|
||||
#undef CPA_WANTS_EXPORT
|
||||
#define CPA_WANTS_IMPORT
|
||||
|
||||
//Module Info
|
||||
CString g_csModuleName;
|
||||
|
||||
//Source Info
|
||||
CString g_csCurrentFileName;
|
||||
short g_wCurrentFileLine;
|
||||
CString g_csLastModif;
|
||||
|
||||
//Global Info
|
||||
CString g_csCurrentAction;
|
||||
CString g_csCurrentFunction;
|
||||
CString g_csAddedInfo;
|
||||
enum ERROR_eErrorGravity g_eErrorGravity;
|
||||
|
||||
//Script Info
|
||||
CString g_csCurrentScriptFileName;
|
||||
short g_wCurrentScriptLine;
|
||||
|
||||
//Programmers Info
|
||||
ErrorOperator_TeamList g_clListOfTeams;
|
||||
|
||||
CStringList g_cslGravityMessages;
|
||||
CStringList g_cslGravityExplanations;
|
||||
|
||||
extern HMODULE g_hModule;
|
||||
|
||||
//************************************************************************************
|
||||
void ERROR_g_fn_vSetGlobalInfo(CString _csCurrentAction,
|
||||
CString _csCurrentFunction,
|
||||
enum ERROR_eErrorGravity _eErrorGravity,
|
||||
CString _csAddedInfo,
|
||||
CString _csModuleName /*= ""*/)
|
||||
{
|
||||
g_eErrorGravity = _eErrorGravity;
|
||||
g_csCurrentAction = _csCurrentAction;
|
||||
g_csCurrentFunction = _csCurrentFunction;
|
||||
g_csAddedInfo = _csAddedInfo;
|
||||
g_csModuleName = _csModuleName;
|
||||
}
|
||||
|
||||
//************************************************************************************
|
||||
void ERROR_g_fn_vSetSourceInfo(CString _csCurrentSourceFile,
|
||||
short _wLine,
|
||||
CString _csDate)
|
||||
{
|
||||
g_csCurrentFileName = _csCurrentSourceFile;
|
||||
g_wCurrentFileLine = _wLine;
|
||||
g_csLastModif = _csDate;
|
||||
}
|
||||
|
||||
//************************************************************************************
|
||||
void ERROR_g_fn_vResetGlobalInfo()
|
||||
{
|
||||
g_eErrorGravity = E_ERROR_GRAVITY_UNKNOWN;
|
||||
g_csCurrentAction = "";
|
||||
g_csCurrentFunction = "";
|
||||
g_csAddedInfo = "";
|
||||
g_csModuleName = "";
|
||||
}
|
||||
|
||||
//************************************************************************************
|
||||
void ERROR_g_fn_vResetSourceInfo()
|
||||
{
|
||||
g_csCurrentFileName = "";
|
||||
g_wCurrentFileLine = -1;
|
||||
g_csLastModif = "";
|
||||
}
|
||||
|
||||
//************************************************************************************
|
||||
void ERROR_g_fn_vSetScriptInfo(CString _csCurrentScriptFileName,
|
||||
short _wCurrentScriptFileLine)
|
||||
{
|
||||
g_csCurrentScriptFileName = _csCurrentScriptFileName;
|
||||
g_wCurrentScriptLine = _wCurrentScriptFileLine;
|
||||
}
|
||||
|
||||
//************************************************************************************
|
||||
void ERROR_g_fn_vResetScriptInfo()
|
||||
{
|
||||
g_csCurrentScriptFileName = "";
|
||||
g_wCurrentScriptLine = -1;
|
||||
}
|
||||
|
||||
//************************************************************************************
|
||||
void ERROR_g_fn_vAddAModuleDescriptor(CString _csModuleName,
|
||||
CString _csModuleVersion,
|
||||
CString _csMainProgrammerName,
|
||||
CString _csMainProgrammerPhoneNumber,
|
||||
CString _csMainProgrammerEMailAddress,
|
||||
CString _csResponsibleName,
|
||||
CString _csResponsiblePhoneNumber,
|
||||
CString _csResponsibleEMailAddress,
|
||||
CString _csSecondProgrammerName,
|
||||
CString _csSecondProgrammerPhoneNumber,
|
||||
CString _csSecondProgrammerEMailAddress
|
||||
)
|
||||
{
|
||||
g_clListOfTeams.m_pub_fn_pclAddTeam(_csModuleName,
|
||||
_csModuleVersion,
|
||||
_csMainProgrammerName,
|
||||
_csMainProgrammerPhoneNumber,
|
||||
_csMainProgrammerEMailAddress,
|
||||
_csResponsibleName,
|
||||
_csResponsiblePhoneNumber,
|
||||
_csResponsibleEMailAddress,
|
||||
_csSecondProgrammerName,
|
||||
_csSecondProgrammerPhoneNumber,
|
||||
_csSecondProgrammerEMailAddress);
|
||||
|
||||
//Updates File
|
||||
//Initializing file name
|
||||
char a_cBuffer[MAX_PATH];
|
||||
GetModuleFileName(g_hModule, a_cBuffer, MAX_PATH);
|
||||
CString csFileName = a_cBuffer;
|
||||
|
||||
short wIndex = csFileName.ReverseFind('\\');
|
||||
if ( wIndex != -1 )
|
||||
csFileName = csFileName.Left(wIndex + 1);
|
||||
|
||||
csFileName += "ErrorOut.txt";
|
||||
|
||||
CStdioFile cfErrorOutFile;
|
||||
|
||||
if ( cfErrorOutFile.Open(csFileName, CFile::modeReadWrite | CFile::modeCreate | CFile::typeText ) )
|
||||
{
|
||||
CString csCurrentString;
|
||||
|
||||
csCurrentString = "Error Operator Module\n";
|
||||
cfErrorOutFile.WriteString(csCurrentString);
|
||||
csCurrentString = "---------------------\n";
|
||||
cfErrorOutFile.WriteString(csCurrentString);
|
||||
csCurrentString = "\n";
|
||||
cfErrorOutFile.WriteString(csCurrentString);
|
||||
csCurrentString = "At last run, known modules were :\n";
|
||||
cfErrorOutFile.WriteString(csCurrentString);
|
||||
csCurrentString = "\n";
|
||||
cfErrorOutFile.WriteString(csCurrentString);
|
||||
|
||||
ErrorOperator_Team *pclCurrentTeam;
|
||||
POSITION pos = g_clListOfTeams.GetHeadPosition();
|
||||
while ( pos != NULL )
|
||||
{
|
||||
pclCurrentTeam = g_clListOfTeams.GetNext(pos);
|
||||
|
||||
csCurrentString = pclCurrentTeam->m_csModuleName + " (" + pclCurrentTeam->m_csMainProgrammerName + ")\n";
|
||||
cfErrorOutFile.WriteString(csCurrentString);
|
||||
}
|
||||
|
||||
csCurrentString = "\n";
|
||||
cfErrorOutFile.WriteString(csCurrentString);
|
||||
csCurrentString = "---------------------\n";
|
||||
cfErrorOutFile.WriteString(csCurrentString);
|
||||
|
||||
cfErrorOutFile.Close();
|
||||
}
|
||||
}
|
58
Rayman_X/cpa/tempgrp/ERO/Src/ErO_Priv.cpp
Normal file
58
Rayman_X/cpa/tempgrp/ERO/Src/ErO_Priv.cpp
Normal file
@@ -0,0 +1,58 @@
|
||||
// ErO Module : private global functions
|
||||
//
|
||||
// YB
|
||||
/////////////////////////////////////////////
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "ErO_Priv.hpp"
|
||||
|
||||
#include "ErO_Op.hpp"
|
||||
|
||||
extern BOOL ERO_g_bInitDone;
|
||||
|
||||
//************************************************************************
|
||||
void ERO_fn_vInit()
|
||||
{
|
||||
ASSERT( !ERO_g_bInitDone );
|
||||
|
||||
//Fills lists of messages
|
||||
g_cslGravityMessages.AddTail("Warning");
|
||||
g_cslGravityMessages.AddTail("Instability Warning");
|
||||
g_cslGravityMessages.AddTail("Fatal Error");
|
||||
g_cslGravityMessages.AddTail("Unknown ...");
|
||||
|
||||
g_cslGravityExplanations.AddTail("Something happened and it should not");
|
||||
g_cslGravityExplanations.AddTail("Something happened which could cause the program to work strangely");
|
||||
g_cslGravityExplanations.AddTail("An error has occured and the program will probably fail");
|
||||
g_cslGravityExplanations.AddTail("The level of Error is unknown : it could be fatal !");
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
void ErO_fn_vBuildStringListForInfos(CString _csOriginalString,
|
||||
CStringList *_pclList)
|
||||
{
|
||||
const CString c_csReturn = '\n';
|
||||
|
||||
if ( !_csOriginalString.IsEmpty() )
|
||||
{
|
||||
CString csTempString(_csOriginalString);
|
||||
short wIndex = 0;
|
||||
BOOL bReturnFound = FALSE;
|
||||
|
||||
while ( wIndex < csTempString.GetLength() )
|
||||
{
|
||||
bReturnFound = ( csTempString.GetAt(wIndex) == c_csReturn );
|
||||
|
||||
if ( !bReturnFound )
|
||||
wIndex ++;
|
||||
else
|
||||
{
|
||||
_pclList->AddTail(csTempString.Left(wIndex));
|
||||
csTempString = csTempString.Right(csTempString.GetLength() - wIndex - 1);
|
||||
|
||||
wIndex = 0;
|
||||
}
|
||||
}
|
||||
_pclList->AddTail(csTempString);
|
||||
}
|
||||
}
|
59
Rayman_X/cpa/tempgrp/ERO/Src/ErO_Stat.cpp
Normal file
59
Rayman_X/cpa/tempgrp/ERO/Src/ErO_Stat.cpp
Normal file
@@ -0,0 +1,59 @@
|
||||
// ErO_Stat.cpp : implementation file
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "ErO_Stat.hpp"
|
||||
|
||||
#include "ErO_DgIf.hpp"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// ErO_StaticForMoreInfos
|
||||
|
||||
BEGIN_MESSAGE_MAP(ErO_StaticForMoreInfos, CStatic)
|
||||
//{{AFX_MSG_MAP(ErO_StaticForMoreInfos)
|
||||
ON_WM_MOUSEMOVE()
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
//***************************************************************************
|
||||
ErO_StaticForMoreInfos::ErO_StaticForMoreInfos()
|
||||
{
|
||||
m_pri_tdeType = ERO_STATIC_TYPE__UNKNOWN;
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
ErO_StaticForMoreInfos::~ErO_StaticForMoreInfos()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// ErO_StaticForMoreInfos message handlers
|
||||
|
||||
//***************************************************************************
|
||||
void ErO_StaticForMoreInfos::OnMouseMove(UINT nFlags, CPoint point)
|
||||
{
|
||||
//Displays additonnal messages
|
||||
CRect crWindowRect;
|
||||
GetWindowRect(crWindowRect);
|
||||
// CPoint cpPoint = crWindowRect.BottomRight();
|
||||
CPoint cpPoint = crWindowRect.TopLeft();
|
||||
|
||||
ErO_MoreInfoDialog dial(this, cpPoint, m_pri_tdeType);
|
||||
dial.DoModal();
|
||||
|
||||
CStatic::OnMouseMove(nFlags, point);
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
void ErO_StaticForMoreInfos::m_pub_fn_vSetType(ErO_tdeStaticType _tdeType)
|
||||
{
|
||||
m_pri_tdeType = _tdeType;
|
||||
}
|
6
Rayman_X/cpa/tempgrp/ERO/Src/StdAfx.cpp
Normal file
6
Rayman_X/cpa/tempgrp/ERO/Src/StdAfx.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// Err.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
|
27
Rayman_X/cpa/tempgrp/ERO/Src/_DLLCom.cpp
Normal file
27
Rayman_X/cpa/tempgrp/ERO/Src/_DLLCom.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "ErO_op.hpp"
|
||||
#include "ErO_Priv.hpp"
|
||||
|
||||
static AFX_EXTENSION_MODULE NEAR extensionDLL = { NULL, NULL };
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Global vars
|
||||
HMODULE g_hModule = 0;
|
||||
BOOL ERO_g_bInitDone = FALSE;
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get current CPA version
|
||||
//========================================================================
|
||||
void __declspec(dllexport) ERO_fn_vInitModule(HMODULE _hModule)
|
||||
{
|
||||
g_hModule = _hModule;
|
||||
|
||||
if ( !ERO_g_bInitDone )
|
||||
{
|
||||
ERO_fn_vInit();
|
||||
ERO_g_bInitDone = TRUE;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user