'MFC'에 해당되는 글 1건

  1. 2009.08.31 CFileDialog의 GetFolderPath 사용시 주의할것. 3
2009. 8. 31. 18:33
GetFolderPath() 시 에러나는 현상이 발생했습니다.

제 컴에(Vista)선 에러가 안나는데 다른 컴(XP)에선 에러가 나길래 당황했으나..

GetFolderPath() 소스를 보니 Vista 일 경우와 XP 일 경우 분기가 나뉘는걸 보고 MSDN을 뒤져봤습니다.
그리고 MSDN 은 이렇게 말합니다.
You can call this method only while the dialog box is being displayed. After the dialog box has been closed, this function will no longer work, and the method will fail with an assertion.

GetFolderPath() .DoModal() 로 Dialog 가 띄어져있는 상태에서만 쓰는거였습니다!!! 으알마랒ㅁ루짛@$%@#$%

GetPathName 으로 fullpath 를 얻어와서 적절하게 나눕시다. [...]

P.S: MSDN에도 저렇게 명시되어 있는데 왜 Vista 는 닫은 Dialog 정보를 갖고있다가 GetFolderPath를 에러없이 반환해준다. 왜일까?..
Posted by envi