Click here to Skip to main content
15,885,767 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

i want to save the file to the specified path using the concept of CStdioFile and CFileDialog.

i am doing like

CFileDialog *dlg = new CFileDialog(FALSE,L"txt"); // open the save file dialog
dlg->DoModal();
CStdioFile fle;
fle.Open(dlg->GetFileName(),CFile::modeCreate|CFile::modeWrite);

but when i am changing the path in the savedialog, it still save in my project folder only.

so how to use the path in my fle.open() ?


Thanks...
Posted

1 solution

The GetFileName() member functions returns the file name without path. So the file is stored in the current directory which is your project folder. To get the file name with the path, use the GetPathName() member function.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900