이 클래스는 c#이랑 비슷하네..
전체경로 - GetPathName()
파일명 - GetFileName() - 5.jpg
폴더경로 - GetFolderPath() - 이건 마지막에 \\써서 쓰면 될듯
확장자 - GetFileExt() - 확장자만 jpg 딱
char szFilter[] = "Image (*.BMP, *.GIF, *.JPG) | *.BMP;*.bmp;*.GIF;*.gif;*.JPG;*.jpg | All Files(*.*)|*.*||";
CFileDialog dlg(TRUE, NULL, NULL, OFN_HIDEREADONLY, szFilter);
OFN_ALLOWMULTISELECT인가 하면 멀티 셀렉트 가능
dlg.m_ofn.lpstrInitialDir = _T(getDesktopFolderName());
if(IDOK == dlg.DoModal()) {
CString strPathName = dlg.GetPathName();
strPathName.AppendFormat("\n\n%s",dlg.GetFileName());
strPathName.AppendFormat("\n\n%s",dlg.GetFolderPath());
strPathName.AppendFormat("\n\n%s",dlg.GetFileExt());
AfxMessageBox(strPathName);
}
150702-----------------------
http://stackoverflow.com/questions/1107913/select-multiple-files-in-cfiledialog
'컴퓨터 과학 & 영상처리 관련 > MFC' 카테고리의 다른 글
스트레치 빌트 함수 - 이미지의 크기를 조절 가능 (0) | 2013.02.09 |
---|---|
다이얼로그에서 다이얼로그 추가 후 텍스트 박스 연동 (0) | 2013.02.06 |
다이얼로그가 선택중이 아니어도 키보드 이벤트 받을 수 있게 (0) | 2013.02.01 |
c++ 현재 응용 프로그램이 활성화 중이 아닌 경우에도 키 인벤트를 받을 수 있나? (0) | 2013.01.23 |
atoi()에 CString 사용안될 시 (0) | 2013.01.17 |