How to get name of a file opened by Open dialog box?
-
Hi friends, How can I get the name of file which is opened by the user by means of open dialog box in a document/view architecture? Thank you, Azadeh
CFileDialog's GetPathName should work Jeff Patterson Programmers speak in Code. http://www.anti-dmca.org[^]
-
CFileDialog's GetPathName should work Jeff Patterson Programmers speak in Code. http://www.anti-dmca.org[^]
-
CFileDialog's GetPathName should work Jeff Patterson Programmers speak in Code. http://www.anti-dmca.org[^]
-
Does
CDocument::GetPathName()
help you? < edit > OOps, did not read enough! You are asking if you can close the file opened by the framework. Probably the answer is 'depends'. Cant you simply overrideCDocument::OnOpenDocument()
with your own load code? -- "My opinions may have changed, but not the fact that I am right." Found in the sig of Herbert Kaminski -
Does
CDocument::GetPathName()
help you? < edit > OOps, did not read enough! You are asking if you can close the file opened by the framework. Probably the answer is 'depends'. Cant you simply overrideCDocument::OnOpenDocument()
with your own load code? -- "My opinions may have changed, but not the fact that I am right." Found in the sig of Herbert KaminskiAs you said , I overrided CDocument::OnOpenDocument() , but I simply open a text file and in that case this function isn't been called.I think it only opens files that are saved with serilizing and using CArchive and it doesn't open my text file.I used a text file to save graphic items that are drawn by the user in my project and I want user can open the file in a symbolic way then I draw the items using text file.However this is enough for me that I can get the name of file even if it hasn't opened really.I thought it opens file and I can not open it simultanously.But even for a file that is saved with the CArchive format, it seems that it opens the corresponding file and then close it because I can open the same file at that time.