Changeset 261 for trunk/DirectShowSpy


Ignore:
Timestamp:
Jan 27, 2014, 6:59:30 AM (10 years ago)
Author:
roman
Message:

Fixed problem being unable to attach a log file while it's still in use/being written; message box showing files failed to get attached

Location:
trunk/DirectShowSpy
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/DirectShowSpy/DirectShowSpy.rc

    r258 r261  
    5959
    6060VS_VERSION_INFO VERSIONINFO
    61  FILEVERSION  1, 0, 0, 1301
     61 FILEVERSION  1, 0, 0, 1319
    6262 PRODUCTVERSION 1,0,0,1
    6363 FILEFLAGSMASK 0x3fL
     
    7878            VALUE "CompanyName", "Roman Ryltsov"
    7979            VALUE "FileDescription", "Alax.Info DirectShow Spy Module"
    80             VALUE "FileVersion",  "1, 0, 0, 1301\0"
     80            VALUE "FileVersion",  "1, 0, 0, 1319\0"
    8181            VALUE "InternalName", "DirectShowSpy.dll"
    8282            VALUE "LegalCopyright", "Copyright © Alax.Info, Roman Ryltsov, 2008-2014"
  • trunk/DirectShowSpy/FilterGraphHelper.h

    r258 r261  
    10381038                                __C(pMessage->put_Subject(CComBSTR(sSubject)));
    10391039                                #pragma region Attachment
    1040                                 CRoArrayT<CPath> DeleteArray;
     1040                                CRoArrayT<CPath> DeletePathArray;
     1041                                CRoArrayT<CString> FailurePathArray;
    10411042                                {
    10421043                                        CEmailLogDialog& EmailLogDialog = m_pOwner->m_EmailLogDialog;
     
    10471048                                                const BOOL bDelete = EmailLogDialog.GetDelete();
    10481049                                                for(SIZE_T nIndex = 0; nIndex < Array.GetCount(); nIndex++)
     1050                                                {
     1051                                                        CEmailLogDialog::CSelectedFileData& FileData = Array[nIndex];
    10491052                                                        _ATLTRY
    10501053                                                        {
    1051                                                                 CEmailLogDialog::CSelectedFileData& FileData = Array[nIndex];
    10521054                                                                CLocalObjectPtr<CBzip2Item> pItem;
    10531055                                                                pItem->LoadFromFile(FileData.m_sPath, nTruncateSize);
     
    10741076                                                                }
    10751077                                                                if(bDelete)
    1076                                                                         DeleteArray.Add(FileData.m_sPath);
     1078                                                                        DeletePathArray.Add(FileData.m_sPath);
    10771079                                                        }
    10781080                                                        _ATLCATCHALL()
    10791081                                                        {
    1080                                                                 _Z_EXCEPTION()
     1082                                                                _Z_EXCEPTION();
     1083                                                                FailurePathArray.Add((LPCTSTR) FileData.m_sPath);
    10811084                                                        }
     1085                                                }
    10821086                                        }
    10831087                                }
    10841088                                #pragma endregion
    10851089                                __C(pMessage->Send());
    1086                                 for(SIZE_T nIndex = 0; nIndex < DeleteArray.GetCount(); nIndex++)
    1087                                         DeleteFile(DeleteArray[nIndex]);
     1090                                for(SIZE_T nIndex = 0; nIndex < DeletePathArray.GetCount(); nIndex++)
     1091                                        DeleteFile(DeletePathArray[nIndex]);
    10881092                                _RegKeyHelper::SetStringValue(HKEY_CURRENT_USER, REGISTRY_ROOT, _T("Email Message Template"), CString(sMessageString));
     1093                                if(!FailurePathArray.IsEmpty())
     1094                                {
     1095                                        const CString sMessage = AtlFormatString(_T("It was unable to attach the following files:") _T("\r\n\r\n") _T("%s"), _StringHelper::Join(FailurePathArray, _T("\r\n")));
     1096                                        AtlMessageBoxEx(m_hWnd, (LPCTSTR) sMessage, IDS_WARNING, MB_ICONWARNING | MB_OK);
     1097                                }
    10891098                                AtlOptionalMessageBoxEx(m_hWnd, _T("CFilterGraphHelper::CPropertyFrameDialog::CEmailDialog::CredentialsSaved"), _T("The email was sent.") _T("\r\n\r\n") _T("The credentials were written into registry for further reuse. Use Erase Cached Credentials link to delete them from registry."), IDS_INFORMATION, MB_ICONINFORMATION | MB_OK);
    10901099                                MessageBeep(MB_OK);
Note: See TracChangeset for help on using the changeset viewer.