openfiledialog not getting correct path for windows 7

October 3, 2016 at 05:10:48
Specs: Windows XP
CFileDialog dlg(FALSE,".mdb",key,OFN_OVERWRITEPROMPT, _T("Export file (*.mdb)|*.mdb||"));
CString filePath ="..\Data\Trans";
dlg.m_ofn.lpstrInitialDir =  filePath	;
dlg.DoModal();

I had set the "dlg.m_ofn.lpstrInitialDir" to particular path , the path is open properly from windows XP , but its not open from Windows 7, its giving some other directory than "trans" to save the file.


See More: openfiledialog not getting correct path for windows 7

Reply ↓  Report •


#1
November 14, 2016 at 05:59:51
could it be that the filepath is not saved in PATH at all?

you can add it yourself by right-clicking "This Computer" in the start menu, select advandced settings edit the PATH variable:

go to the end of the value and type;

;..\Data\Trans

; is neccecary, followed by the full path

I have no clue how else i could help

Good luck!


Reply ↓  Report •

#2
November 14, 2016 at 20:35:09
Sorry , but I don't want to set that path in "PATH" for windows7, I just want to open the files from that specified path by OpenFile.

message edited by HarshadaNatu


Reply ↓  Report •

Related Solutions


Ask Question