Спасибо, но так получилось, что я уже переделал, свой проект и теперь путь просекаю через CFileDialog. Возможно кому-то окажеться полезным знать как, посему вот как я поступил:
Код | TCHAR title[] = "Open file to sniff words in"; //Creating dilog window object CFileDialog openDlgWnd(TRUE);
CString str(""); str += "Text files (*.txt,*.asc,*.text)"; str+=(TCHAR)NULL; str+="*.txt; *.asc; *.text";str+=(TCHAR)NULL; str += "HTML Documents (*.htm,*.shtml,*.plg)"; str+=(TCHAR)NULL; str+="*.htm; *.shtml; *.plg";str+=(TCHAR)NULL; str += "All files (*.*)"; str+=(TCHAR)NULL; str+="*.*";str+=(TCHAR)NULL;
//Launch filter openDlgWnd.m_ofn.lpstrFilter = str; // openDlgWnd.m_ofn.nFilterIndex = 1; // TCHAR openFileName[_MAX_PATH]; // openFileName[0] = (TCHAR)NULL; // openDlgWnd.m_ofn.lpstrFile=openFileName; // openDlgWnd.m_ofn.lpstrTitle = title; //We'll be able to select a few files openDlgWnd.m_ofn.Flags |= OFN_ALLOWMULTISELECT;
if(openDlgWnd.DoModal()==IDOK){ CChildFrame *pWnd = (CChildFrame *)GetActiveFrame(); pWnd->SetWindowText(openDlgWnd.m_ofn.lpstrFile); }
|
Вот здесь:openDlgWnd.m_ofn.lpstrFileХраниться полный путь к файлу. |