Programming/MFC
파일 다이얼로그에서 여러개 파일 한번에 오픈하기
_Erato
2006. 4. 6. 00:57
void CMHG_2000Doc::OnFileOpen()
{
// TODO: 여기에 명령 처리기 코드를 추가합니다.
CString strFilter = "RTP file(*.rtp)|*.rtp|SDP file(*.sdp)|*.sdp|ALL file(*.*)|*.*|" ;
CFileDialog fileDlg( TRUE, NULL, NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT | OFN_ALLOWMULTISELECT, strFilter ) ;
TCHAR* fileName ;
fileName = new TCHAR[1001] ;
ZeroMemory( fileName, sizeof( fileName ) ) ;
fileDlg.m_ofn.lpstrFile = fileName ;
fileDlg.m_ofn.nMaxFile = 1000 ;
if(fileDlg.DoModal() == IDOK)
{
POSITION pos = fileDlg.GetStartPosition() ;
while ( pos != NULL )
{
AfxMessageBox( fileDlg.GetNextPathName( pos ) ) ;
}
}
delete []fileName ;
}