프로젝트를 진행하다 보니 MFC가 편할때도 있지만 불편한 경우도 많은 것 같다.
MFC 위주로 코딩햇지만 이제는 MFC를 자제하려고 노력중.
폴더 내 파일 탐색을 할 경우 MFC 에서는 CFileFinder 가 있어서 편했지만
c++에서 이녀석을 대체할 _finddata_t 를 이용해서 파일을 탐색 해보자.
- #include <io.h>
- _finddata_t filefinder;
- long handle;
- int nExistNext = 1;
- handle = _findfirst(".\\*.*", &filefinder);
- if (handle == -1)
- {
- printf("There was no file.\n");
- return;
- }
- while (nExistNext != -1)
- {
- printf("FileName : %s\n", filefinder.name);
- nExistNext = _findnext(handle, &filefinder);
- }
- _findclose(handle);
- return;
'Programming > C, C++, MFC' 카테고리의 다른 글
visual studio 프로젝트 및 솔루션 이름을 변경하기. (0) | 2016.05.17 |
---|---|
HTTP 프로토콜을 이용하여 웹상의 파일을 다운로드 하자. (0) | 2016.03.09 |
성능 및 메모리 관점에서 살펴본 if문과 switch 문의 차이점 (0) | 2015.04.21 |
[VS2013] error MSB8031 - 멀티바이트문자집합 에러를 해결하자. (0) | 2015.03.06 |
Dialog에 Drag&Drop 기능을 적용하자. (0) | 2014.12.01 |