// CrashReportDlg.cpp : ±¸Çö ÆÄÀÏ // #include "stdafx.h" #include "CrashReport.h" #include "CrashReportDlg.h" #include "XLEzAutomation.h" #ifdef _DEBUG #define new DEBUG_NEW #endif TCHAR LISTCTRLSTRING[eSTRINGTABLE_TABLEMAX][255] = { {L"No."}, {L"¼Ò½ºÀ§Ä¡"}, {L"¶óÀÎÀ§Ä¡"}, {L"Ãæµ¹ÁÖ¼Ò"}, {L"Ãæµ¹ÇÔ¼ö"}, {L"Ãæµ¹µÈ °¹¼ö"}, {L"¹éºÐÀ§"}, {L"Å©·¹½¬ ¿øÀÎ"}, }; // ÀÀ¿ë ÇÁ·Î±×·¥ Á¤º¸¿¡ »ç¿ëµÇ´Â CAboutDlg ´ëÈ­ »óÀÚÀÔ´Ï´Ù. class CAboutDlg : public CDialog { public: CAboutDlg(); // ´ëÈ­ »óÀÚ µ¥ÀÌÅÍÀÔ´Ï´Ù. enum { IDD = IDD_ABOUTBOX }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV Áö¿øÀÔ´Ï´Ù. // ±¸ÇöÀÔ´Ï´Ù. protected: DECLARE_MESSAGE_MAP() public: afx_msg void OnUpdateLoadmap(CCmdUI *pCmdUI); }; CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD) { } void CAboutDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); } BEGIN_MESSAGE_MAP(CAboutDlg, CDialog) ON_UPDATE_COMMAND_UI(ID_LOADMAP, &CAboutDlg::OnUpdateLoadmap) END_MESSAGE_MAP() // CCrashReportDlg ´ëÈ­ »óÀÚ static int CALLBACK BrowseProc( HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData ) { if( BFFM_INITIALIZED == uMsg ) SendMessage( hwnd, BFFM_SETSELECTION, (WPARAM)TRUE, (LPARAM)lpData ); return 0; } CCrashReportDlg::CCrashReportDlg(CWnd* pParent /*=NULL*/) : CDialog(CCrashReportDlg::IDD, pParent) { m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); } void CCrashReportDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); DDX_Control(pDX, IDC_REPORTLIST, cListCtrl_CrashInfo_); DDX_Control(pDX, IDC_LISTDMPEXCEP, ListExceptionDmpFile_); DDX_Control(pDX, IDC_LISTRESULTDMP, ResultDumpListView_); DDX_Control(pDX, IDC_LISTCALLSTACK, CallStackList_); } BEGIN_MESSAGE_MAP(CCrashReportDlg, CDialog) ON_WM_SYSCOMMAND() ON_WM_PAINT() ON_WM_QUERYDRAGICON() //}}AFX_MSG_MAP ON_COMMAND(ID_LOADDIR, &CCrashReportDlg::OnLoaddir) ON_COMMAND(ID_LOADPDB, &CCrashReportDlg::OnLoadpdb) ON_UPDATE_COMMAND_UI(ID_LOADMAP, &CCrashReportDlg::OnUpdateLoadmap) ON_BN_CLICKED(IDC_BUTTON1, &CCrashReportDlg::OnBnClickedButton1) ON_NOTIFY(LVN_COLUMNCLICK, IDC_REPORTLIST, &CCrashReportDlg::OnLvnColumnclickReportlist) ON_NOTIFY(NM_RCLICK, IDC_REPORTLIST, &CCrashReportDlg::OnNMRClickReportlist) ON_NOTIFY(NM_CLICK, IDC_REPORTLIST, &CCrashReportDlg::OnNMClickReportlist) ON_LBN_SELCHANGE(IDC_LISTRESULTDMP, &CCrashReportDlg::OnLbnSelchangeListresultdmp) ON_COMMAND(ID_EXPORTEX, &CCrashReportDlg::OnExportex) ON_COMMAND(ID_SENDMAIL, &CCrashReportDlg::OnSendmail) END_MESSAGE_MAP() // CCrashReportDlg ¸Þ½ÃÁö 󸮱â BOOL CCrashReportDlg::OnInitDialog() { CDialog::OnInitDialog(); // ½Ã½ºÅÛ ¸Þ´º¿¡ "Á¤º¸..." ¸Þ´º Ç׸ñÀ» Ãß°¡ÇÕ´Ï´Ù. // IDM_ABOUTBOX´Â ½Ã½ºÅÛ ¸í·É ¹üÀ§¿¡ ÀÖ¾î¾ß ÇÕ´Ï´Ù. ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); ASSERT(IDM_ABOUTBOX < 0xF000); CMenu* pSysMenu = GetSystemMenu(FALSE); if (pSysMenu != NULL) { CString strAboutMenu; strAboutMenu.LoadString(IDS_ABOUTBOX); if (!strAboutMenu.IsEmpty()) { pSysMenu->AppendMenu(MF_SEPARATOR); pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); } } // ÀÌ ´ëÈ­ »óÀÚÀÇ ¾ÆÀÌÄÜÀ» ¼³Á¤ÇÕ´Ï´Ù. ÀÀ¿ë ÇÁ·Î±×·¥ÀÇ ÁÖ Ã¢ÀÌ ´ëÈ­ »óÀÚ°¡ ¾Æ´Ò °æ¿ì¿¡´Â // ÇÁ·¹ÀÓ¿öÅ©°¡ ÀÌ ÀÛ¾÷À» ÀÚµ¿À¸·Î ¼öÇàÇÕ´Ï´Ù. SetIcon(m_hIcon, TRUE); // Å« ¾ÆÀÌÄÜÀ» ¼³Á¤ÇÕ´Ï´Ù. SetIcon(m_hIcon, FALSE); // ÀÛÀº ¾ÆÀÌÄÜÀ» ¼³Á¤ÇÕ´Ï´Ù. // TODO: ¿©±â¿¡ Ãß°¡ ÃʱâÈ­ ÀÛ¾÷À» Ãß°¡ÇÕ´Ï´Ù. InitListCtrl(); CallStackList_.ResetContent(); ExceptionListStruct_List_.clear(); DumpFileList_.clear(); NotFindDumpMemoryList_.clear(); DialogMailSender_.Create(CDlgMailSender::IDD,this); DialogMailSender_.ShowWindow(SW_HIDE); return TRUE; // Æ÷Ä¿½º¸¦ ÄÁÆ®·Ñ¿¡ ¼³Á¤ÇÏÁö ¾ÊÀ¸¸é TRUE¸¦ ¹ÝȯÇÕ´Ï´Ù. } void CCrashReportDlg::OnSysCommand(UINT nID, LPARAM lParam) { if ((nID & 0xFFF0) == IDM_ABOUTBOX) { CAboutDlg dlgAbout; dlgAbout.DoModal(); } else { CDialog::OnSysCommand(nID, lParam); } } // ´ëÈ­ »óÀÚ¿¡ ÃÖ¼ÒÈ­ ´ÜÃ߸¦ Ãß°¡ÇÒ °æ¿ì ¾ÆÀÌÄÜÀ» ±×¸®·Á¸é // ¾Æ·¡ Äڵ尡 ÇÊ¿äÇÕ´Ï´Ù. ¹®¼­/ºä ¸ðµ¨À» »ç¿ëÇÏ´Â MFC ÀÀ¿ë ÇÁ·Î±×·¥ÀÇ °æ¿ì¿¡´Â // ÇÁ·¹ÀÓ¿öÅ©¿¡¼­ ÀÌ ÀÛ¾÷À» ÀÚµ¿À¸·Î ¼öÇàÇÕ´Ï´Ù. void CCrashReportDlg::OnPaint() { if (IsIconic()) { CPaintDC dc(this); // ±×¸®±â¸¦ À§ÇÑ µð¹ÙÀ̽º ÄÁÅØ½ºÆ® SendMessage(WM_ICONERASEBKGND, reinterpret_cast(dc.GetSafeHdc()), 0); // Ŭ¶óÀÌ¾ðÆ® »ç°¢Çü¿¡¼­ ¾ÆÀÌÄÜÀ» °¡¿îµ¥¿¡ ¸ÂÃä´Ï´Ù. int cxIcon = GetSystemMetrics(SM_CXICON); int cyIcon = GetSystemMetrics(SM_CYICON); CRect rect; GetClientRect(&rect); int x = (rect.Width() - cxIcon + 1) / 2; int y = (rect.Height() - cyIcon + 1) / 2; // ¾ÆÀÌÄÜÀ» ±×¸³´Ï´Ù. dc.DrawIcon(x, y, m_hIcon); } else { CDialog::OnPaint(); } } // »ç¿ëÀÚ°¡ ÃÖ¼ÒÈ­µÈ âÀ» ²ô´Â µ¿¾È¿¡ Ä¿¼­°¡ Ç¥½ÃµÇµµ·Ï ½Ã½ºÅÛ¿¡¼­ // ÀÌ ÇÔ¼ö¸¦ È£ÃâÇÕ´Ï´Ù. HCURSOR CCrashReportDlg::OnQueryDragIcon() { return static_cast(m_hIcon); } BOOL CCrashReportDlg::PreTranslateMessage(MSG* pMsg) { // TODO: ¿©±â¿¡ Ư¼öÈ­µÈ Äڵ带 Ãß°¡ ¹×/¶Ç´Â ±âº» Ŭ·¡½º¸¦ È£ÃâÇÕ´Ï´Ù. if(pMsg->message == WM_KEYDOWN) { switch(pMsg->wParam) { case VK_RETURN: case VK_ESCAPE: { pMsg->wParam = NULL; } default: break; } } return CDialog::PreTranslateMessage(pMsg); } bool CCrashReportDlg::GetFolderPath( CString& Path ) { TCHAR szPathName[MAX_PATH]; BROWSEINFO cBrowseInfo; cBrowseInfo.hwndOwner = GetSafeHwnd(); cBrowseInfo.pidlRoot = NULL; cBrowseInfo.pszDisplayName = szPathName; cBrowseInfo.lpszTitle = _T("µð·ºÅ丮¸¦ ¼±ÅÃÇϽÿÀ"); cBrowseInfo.ulFlags = BIF_RETURNONLYFSDIRS; cBrowseInfo.lpfn = BrowseProc; cBrowseInfo.lParam = (LPARAM)_T("J:\\"); ITEMIDLIST* pidlBrowse = ::SHBrowseForFolder( &cBrowseInfo ); if( pidlBrowse ) { ::SHGetPathFromIDList( pidlBrowse, szPathName ); Path = szPathName; return TRUE; } return FALSE; } void CCrashReportDlg::OnLoaddir() { // TODO: ¿©±â¿¡ ¸í·É 󸮱â Äڵ带 Ãß°¡ÇÕ´Ï´Ù. //ÀÌ¹Ì µÎ°³°¡ ½ÇÇàµÈ »óÅÂ! ´Ù½Ã ¼ÂÆÃÀ» ÇÏÀÚ. if (DumpFileList_.size() > 0 && GPROCESSMANAGER.GetProcess() != NULL) ReleaseFileSetting(); CString CrashDir = _T(""); if(GetFolderPath(CrashDir)) { CWnd* TextWindow = GetDlgItem(IDC_FOLDERPATH); TextWindow->SetWindowText(CrashDir); CFileFind fileFind; CrashDir += L"\\*.*"; bool findfilebool = fileFind.FindFile(CrashDir); while(findfilebool) { findfilebool = fileFind.FindNextFile(); if(fileFind.IsDots()) continue; if (fileFind.IsDirectory()) continue; else { CDumpProcess dumpElement; if(dumpElement.LoadFile(fileFind.GetFilePath())) DumpFileList_[fileFind.GetFilePath()] = dumpElement; } } } } void CCrashReportDlg::OnLoadpdb() { //ÀÌ¹Ì µÎ°³°¡ ½ÇÇàµÈ »óÅÂ! ´Ù½Ã ¼ÂÆÃÀ» ÇÏÀÚ. if (DumpFileList_.size() > 0 && GPROCESSMANAGER.GetProcess() != NULL) ReleaseFileSetting(); // TODO: ¿©±â¿¡ ¸í·É 󸮱â Äڵ带 Ãß°¡ÇÕ´Ï´Ù. CString FileFormatDefine = _T("Symbol File (*.EXE) | *.EXE; | All Files(*.*)|*.*||"); CFileDialog FileDlg(TRUE,NULL,NULL,OFN_HIDEREADONLY|OFN_NOCHANGEDIR,FileFormatDefine); if(FileDlg.DoModal()) { CString FileName = FileDlg.GetPathName(); CWnd* TextWindow = GetDlgItem(IDC_PDBPATH); TextWindow->SetWindowText(FileName); GPROCESSMANAGER.CreateSymbolType(CBaseProcess::eSYMBOLTYPE_PDB); GPROCESSMANAGER.LoadSymbolPath(FileName); } } void CAboutDlg::OnUpdateLoadmap(CCmdUI *pCmdUI) { } void CCrashReportDlg::InitListCtrl() { cListCtrl_CrashInfo_.DeleteAllItems(); cListCtrl_CrashInfo_.SetExtendedStyle(LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT); cListCtrl_CrashInfo_.InsertColumn(eSTRINGTABLE_NUMBER,LISTCTRLSTRING[eSTRINGTABLE_NUMBER],0,80); cListCtrl_CrashInfo_.InsertColumn(eSTRINGTABLE_CRASHLINE, LISTCTRLSTRING[eSTRINGTABLE_CRASHLINE],0,400); cListCtrl_CrashInfo_.InsertColumn(eSTRINGTABLE_CRASHMODULE, LISTCTRLSTRING[eSTRINGTABLE_CRASHMODULE],0,80); cListCtrl_CrashInfo_.InsertColumn(eSTRINGTABLE_CRASHADDR, LISTCTRLSTRING[eSTRINGTABLE_CRASHADDR],0,80); cListCtrl_CrashInfo_.InsertColumn(eSTRINGTABLE_CRASHFUNC, LISTCTRLSTRING[eSTRINGTABLE_CRASHFUNC],0,180); cListCtrl_CrashInfo_.InsertColumn(eSTRINGTABLE_CRASHCOUNT, LISTCTRLSTRING[eSTRINGTABLE_CRASHCOUNT],0,80); cListCtrl_CrashInfo_.InsertColumn(eSTRINGTABLE_CRASHPERCENT, LISTCTRLSTRING[eSTRINGTABLE_CRASHPERCENT],0,80); cListCtrl_CrashInfo_.InsertColumn(eSTRINGTABLE_CRASHSHOW, LISTCTRLSTRING[eSTRINGTABLE_CRASHSHOW],0,170); } bool CCrashReportDlg::SetListCtrlPush( const ExceptionListStruct& info,int cell ) { ExceptionListStruct CrashData = info; CString ItemConvertString; ItemConvertString.Format(L"%d",cell); cListCtrl_CrashInfo_.InsertItem(cell,ItemConvertString); cListCtrl_CrashInfo_.SetItemText(cell,0,ItemConvertString); cListCtrl_CrashInfo_.SetItemText(cell,1,info.ExceptionInfo.ExceptionFileName); ItemConvertString.Format(L"%d",(int)info.ExceptionInfo.FileSourceLine); cListCtrl_CrashInfo_.SetItemText(cell,2,ItemConvertString); ItemConvertString.Format(L"0x%x",(int)info.ExceptionAddr); cListCtrl_CrashInfo_.SetItemText(cell,3,ItemConvertString); cListCtrl_CrashInfo_.SetItemText(cell,4,info.ExceptionInfo.ExceptionFuntionName); ItemConvertString.Format(L"%d",(int)info.ExceptionListCount); cListCtrl_CrashInfo_.SetItemText(cell,5,ItemConvertString); float percent = (float)info.ExceptionListCount / (float)DumpFileList_.size(); ItemConvertString.Format(L"%.2f %%",percent * 100.0f); cListCtrl_CrashInfo_.SetItemText(cell,6,ItemConvertString); cListCtrl_CrashInfo_.SetItemText(cell,7,CrashData.ExceptionshowString); return true; } void CCrashReportDlg::OnUpdateLoadmap(CCmdUI *pCmdUI) { //ÀÌ¹Ì µÎ°³°¡ ½ÇÇàµÈ »óÅÂ! ´Ù½Ã ¼ÂÆÃÀ» ÇÏÀÚ. if (DumpFileList_.size() > 0 && GPROCESSMANAGER.GetProcess() != NULL) ReleaseFileSetting(); // TODO: ¿©±â¿¡ ¸í·É ¾÷µ¥ÀÌÆ® UI 󸮱â Äڵ带 Ãß°¡ÇÕ´Ï´Ù. CString FileFormatDefine = _T("Symbol File (*.Map) | *.Map; | All Files(*.*)|*.*||"); CFileDialog FileDlg(TRUE,NULL,NULL,OFN_HIDEREADONLY|OFN_NOCHANGEDIR,FileFormatDefine); if(FileDlg.DoModal()) { CString FileName = FileDlg.GetPathName(); CWnd* TextWindow = GetDlgItem(IDC_PDBPATH); TextWindow->SetWindowText(FileName); GPROCESSMANAGER.CreateSymbolType(CBaseProcess::eSYMBOLTYPE_MAP); GPROCESSMANAGER.LoadSymbolPath(FileName); } } void CCrashReportDlg::OnBnClickedButton1() { // TODO: ¿©±â¿¡ ÄÁÆ®·Ñ ¾Ë¸² 󸮱â Äڵ带 Ãß°¡ÇÕ´Ï´Ù. if (DumpFileList_.empty()) { MessageBox(L"ÇöÀç ´ýÇÁ ÆÄÀÏÀÌ ·Îµå µÇÁö ¾Ê¾Ò½À´Ï´Ù.",L"¿À·ù",MB_OK); return; } if(!GPROCESSMANAGER.GetProcess()) { MessageBox(L"ÇöÀç ½Éº¼ ÆÄÀÏÀÌ ·Îµå µÇÁö ¾Ê¾Ò½À´Ï´Ù.",L"¿À·ù",MB_OK); return; } int FindResultDump = 0; std::map::iterator iterDumpList = DumpFileList_.begin(); for ( ; iterDumpList != DumpFileList_.end() ; ++iterDumpList) { DWORD AddressException = (DWORD)iterDumpList->second.GetExceptionAddr(); sExceptionInfomation ExceptionInfo; ExceptionInfo.OnInit(); if(GPROCESSMANAGER.GetProcess()->OnSearch(AddressException,ExceptionInfo)) { //Á¤º¸¸¦ °¡Áø ´ýÇÁ°¡ Á¸Àç ÇÔÀ¸·Î ExceptionListStruct AcceseExceptionFunction; AcceseExceptionFunction.OnInit(); AcceseExceptionFunction.ExceptionAddr = AddressException; AcceseExceptionFunction.ExceptionInfo = ExceptionInfo; AcceseExceptionFunction.versionInfo = -1; wsprintf(AcceseExceptionFunction.ExceptionshowString,L"%s", iterDumpList->second.GetExceptionCodeStr()); //´ýÇÁ¿¡ ´ëÇÑ °Ë»ç´Â ¿¹¿Ü·Î ó¸®µÈ ÁÖ¼Ò·Î °Ë»ç ÇÑ´Ù. std::vector::iterator iter = std::find(ExceptionListStruct_List_.begin(),ExceptionListStruct_List_.end() ,AddressException); if(iter == ExceptionListStruct_List_.end()) { AcceseExceptionFunction.FindDumpMemoryList_.push_back(iterDumpList->first); ExceptionListStruct_List_.push_back(AcceseExceptionFunction); } else { (*iter).ExceptionListCount += 1; (*iter).FindDumpMemoryList_.push_back(iterDumpList->first); } FindResultDump++; } else { //À̺κп¡¼­´Â ¸Þ¸ð¸® ÁÖ¼Ò°¡ Á¸Àç ÇÏÁö ¾Ê´Â dmpÆÄÀÏ ¸®½ºÆ®°¡ µé¾î°£´Ù. NotFindDumpMemoryList_.push_back(iterDumpList->first); ListExceptionDmpFile_.AddString(iterDumpList->first); } } int ListCount = 0;; for(size_t count = 0 ; count < ExceptionListStruct_List_.size() ; ++count) { SetListCtrlPush(ExceptionListStruct_List_[count],count); } CString IntgerToString; IntgerToString.Format(L"%d",NotFindDumpMemoryList_.size()); CWnd* TextWindow = GetDlgItem(IDC_NODMPLIST); TextWindow->SetWindowText(IntgerToString); IntgerToString.Format(L"%d",FindResultDump); TextWindow = GetDlgItem(IDC_OKDMPLIST); TextWindow->SetWindowText(IntgerToString); IntgerToString.Format(L"%d",DumpFileList_.size()); TextWindow = GetDlgItem(IDC_ALLFILE); TextWindow->SetWindowText(IntgerToString); } void CCrashReportDlg::OnLvnColumnclickReportlist(NMHDR *pNMHDR, LRESULT *pResult) { LPNMLISTVIEW pNMLV = reinterpret_cast(pNMHDR); // TODO: ¿©±â¿¡ ÄÁÆ®·Ñ ¾Ë¸² 󸮱â Äڵ带 Ãß°¡ÇÕ´Ï´Ù. *pResult = 0; } void CCrashReportDlg::OnNMRClickReportlist(NMHDR *pNMHDR, LRESULT *pResult) { //LPNMITEMACTIVATE pNMItemActivate = reinterpret_cast(pNMHDR); // TODO: ¿©±â¿¡ ÄÁÆ®·Ñ ¾Ë¸² 󸮱â Äڵ带 Ãß°¡ÇÕ´Ï´Ù. *pResult = 0; // LPNMLISTVIEW ListView = reinterpret_cast(pNMHDR); // CString test = cListCtrl_CrashInfo_.GetItemText(ListView->uChanged,0); } void CCrashReportDlg::OnNMClickReportlist(NMHDR *pNMHDR, LRESULT *pResult) { // LPNMITEMACTIVATE pNMItemActivate = reinterpret_cast(pNMHDR); // TODO: ¿©±â¿¡ ÄÁÆ®·Ñ ¾Ë¸² 󸮱â Äڵ带 Ãß°¡ÇÕ´Ï´Ù. *pResult = 0; LPNMLISTVIEW ListView = reinterpret_cast(pNMHDR); CString test = cListCtrl_CrashInfo_.GetItemText(ListView->iItem,1); //¾ÆÀÌÅÛÀÌ -1·Î ³Ñ¾î¿Ã °æ¿ì°¡ ÀÖ´Ù. if(ListView->iItem < 0) return; ExceptionListStruct exceptionposition = ExceptionListStruct_List_[ListView->iItem]; //Àϵý ÀÌÀü ÄÁÆ®·Ñ °ª »èÁ¦ ResultDumpListView_.ResetContent(); //¿ì Ŭ¸¯½Ã¿¡ ´ýÇÁ ÆÄÀÏÀ» »ý¼º Çϵµ·Ï ¸¸µë for(size_t findCount = 0; findCount < exceptionposition.FindDumpMemoryList_.size() ; ++findCount) ResultDumpListView_.AddString(exceptionposition.FindDumpMemoryList_[findCount]); } //´ýÇÁµéÀÇ Á¤º¸¸¦ º¸¿©ÁØ´Ù. void CCrashReportDlg::OnLbnSelchangeListresultdmp() { // TODO: ¿©±â¿¡ ÄÁÆ®·Ñ ¾Ë¸² 󸮱â Äڵ带 Ãß°¡ÇÕ´Ï´Ù. int getCulCell = ResultDumpListView_.GetCurSel(); if(getCulCell == -1) return; CString ListToString; ResultDumpListView_.GetText(getCulCell,ListToString); // std::map::iterator iterMap = DumpFileList_.find(ListToString); if(iterMap == DumpFileList_.end()) return; CDumpProcess DumpProcessItem = iterMap->second; CString IntgerToString; IntgerToString.Format(L"%d",DumpProcessItem.GetProcessTime()); CWnd* TextWindow = GetDlgItem(IDC_PROCESSTIME); TextWindow->SetWindowText(IntgerToString); IntgerToString.Format(L"%d",DumpProcessItem.GetUserTime()); TextWindow = GetDlgItem(IDC_USERTIME); TextWindow->SetWindowText(IntgerToString); IntgerToString.Format(L"%d",DumpProcessItem.GetKerenlTime()); TextWindow = GetDlgItem(IDC_KERNERTIME); TextWindow->SetWindowText(IntgerToString); TextWindow = GetDlgItem(IDC_CRASHCODE); TextWindow->SetWindowText(DumpProcessItem.GetExceptionCodeStr()); IntgerToString.Format(L"0x%x",DumpProcessItem.GetExceptionAddr()); TextWindow = GetDlgItem(IDC_CRASHINFO2); TextWindow->SetWindowText(IntgerToString); TextWindow = GetDlgItem(IDC_MODULEINFO); TextWindow->SetWindowText(DumpProcessItem.GetModuleInfo()); IntgerToString.Format(L"%d",DumpProcessItem.GetMajorVersion()); TextWindow = GetDlgItem(IDC_VERINFO); TextWindow->SetWindowText(IntgerToString); IntgerToString.Format(L"%d",DumpProcessItem.GetBuildNumber()); TextWindow = GetDlgItem(IDC_BUILDNUM); TextWindow->SetWindowText(IntgerToString); IntgerToString.Format(L"%d",DumpProcessItem.GetPlatformId()); TextWindow = GetDlgItem(IDC_PLATFORMID); TextWindow->SetWindowText(IntgerToString); } //¸ðµÎ ÃʱâÈ­ ÇÏ´Â ÄÚµå void CCrashReportDlg::ReleaseFileSetting() { GPROCESSMANAGER.DestoryProcess(); cListCtrl_CrashInfo_.DeleteAllItems(); ListExceptionDmpFile_.ResetContent(); ResultDumpListView_.ResetContent(); CallStackList_.ResetContent(); ExceptionListStruct_List_.clear(); NotFindDumpMemoryList_.clear(); DumpFileList_.clear(); CWnd* TextWindow = GetDlgItem(IDC_PROCESSTIME); TextWindow->SetWindowText(L""); TextWindow = GetDlgItem(IDC_USERTIME); TextWindow->SetWindowText(L""); TextWindow = GetDlgItem(IDC_KERNERTIME); TextWindow->SetWindowText(L""); TextWindow = GetDlgItem(IDC_CRASHCODE); TextWindow->SetWindowText(L""); TextWindow = GetDlgItem(IDC_CRASHINFO2); TextWindow->SetWindowText(L""); TextWindow = GetDlgItem(IDC_MODULEINFO); TextWindow->SetWindowText(L""); TextWindow = GetDlgItem(IDC_VERINFO); TextWindow->SetWindowText(L""); TextWindow = GetDlgItem(IDC_BUILDNUM); TextWindow->SetWindowText(L""); TextWindow = GetDlgItem(IDC_PLATFORMID); TextWindow->SetWindowText(L""); TextWindow = GetDlgItem(IDC_NODMPLIST); TextWindow->SetWindowText(L""); TextWindow = GetDlgItem(IDC_OKDMPLIST); TextWindow->SetWindowText(L""); TextWindow = GetDlgItem(IDC_ALLFILE); TextWindow->SetWindowText(L""); TextWindow = GetDlgItem(IDC_PDBPATH); TextWindow->SetWindowText(L""); TextWindow = GetDlgItem(IDC_FOLDERPATH); TextWindow->SetWindowText(L""); } //¿¢¼¿·Î ¸®Æ÷ÆÃ ÀúÀå void CCrashReportDlg::OnExportex() { // TODO: ¿©±â¿¡ ¸í·É 󸮱â Äڵ带 Ãß°¡ÇÕ´Ï´Ù. int listcontrolItemcount = cListCtrl_CrashInfo_.GetItemCount(); int columnMax = eSTRINGTABLE_TABLEMAX; int rowNumMax = (int)ExceptionListStruct_List_.size(); int CellNum = 2; CString StrFileName; //ó¸® °úÁ¤À» º¸¿© ÁÖÁö ¾Ê´Â´Ù. CXLEzAutomation ExccelFile(false); //½Ã½ºÅÛ Å¸ÀÓÀ» ¹Þ¾Æ¿Â´Ù. SYSTEMTIME SystemTime; GetSystemTime(&SystemTime); CString FileNameFormat; //ÀÏ-½Ã°£-ºÐ-ÃÊ·Î À̸§ÀÌ °ãÄ¡Áö ¾Êµµ·Ï ÇÑ´Ù. FileNameFormat.Format(L"CrashReport_%d_%d_%d_%d.xlsx",SystemTime.wDay,SystemTime.wHour, SystemTime.wMinute,SystemTime.wSecond); ExccelFile.OpenExcelFile(FileNameFormat); for (int ExcelList = 0 ; ExcelList < eSTRINGTABLE_TABLEMAX ; ++ExcelList) { ExccelFile.SetCellValue(ExcelList,1,LISTCTRLSTRING[ExcelList]); } //¿¢¼¿¿¡ ¸®½ºÆ® ÄÁÆ®·Ñ °ª ÀúÀå for (int RowCount = 0 ; RowCount < rowNumMax ; ++RowCount) { for (int ColumnCount = 0 ; ColumnCount < columnMax ; ++ColumnCount) { CString ListText = cListCtrl_CrashInfo_.GetItemText(RowCount,ColumnCount); ExccelFile.SetCellValue(ColumnCount,CellNum,ListText); } CellNum++; } //Áß°£¿¡ ºó °ø¹éÀÌ µé¾î °£´Ù. CellNum++; ExccelFile.SetCellValue(1,CellNum++,L"¿¹¿Ü ´ýÇÁ ÆÄÀÏ ¸ñ·Ï"); //¿¹¿Ü ÆÄÀÏ ÀÔ·Â for (size_t ExceptionDmp = 0 ; ExceptionDmp < NotFindDumpMemoryList_.size() ; ++ExceptionDmp) { ExccelFile.SetCellValue(1,CellNum,NotFindDumpMemoryList_[ExceptionDmp]); CellNum++; } ExccelFile.SaveFileAs(FileNameFormat); ExccelFile.ReleaseExcel(); theApp.Excelfile = FileNameFormat; } void CCrashReportDlg::OnSendmail() { // TODO: ¿©±â¿¡ ¸í·É 󸮱â Äڵ带 Ãß°¡ÇÕ´Ï´Ù. DialogMailSender_.ShowWindow(SW_SHOW); }