Post

MRU 리스트에서 항목 제거

프로젝트의 AppClass에서

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <afxadv.h> ///< FOR CRecentFileList

void CXXXApp::RemoveMRUString(const CString &rMRU)
{
 char szBuf[MAX_PATH] = {'\0' ,};
 const int nMRUSize = m_pRecentFileList->GetSize();
 for( int i = 0;i < nMRUSize;++i)
 {
  CString rName = m_pRecentFileList->m_arrNames[ i ];
  if( rMRU == rName )
  {
   m_pRecentFileList->Remove( i );
   break;
  }
 }

 if( i != nMRUSize ) m_pRecentFileList->WriteList();
}