On my MFC application I read file and do some process on it. Here is the code I used to open and read only.

CFile srf_ReadFile;
char * srf_FilePath = "ReadFile_001.txt";
if(srf_ReadFile.Open(srf_FilePath, CFile::modeRead))
// Do the required process here on ReadFile_001.txt

So, the file should be always in the same folder which the project/solution contain. If I want to read another file, say ReadFile_002.txt, have to do it manually, go to the code and gives the new file name.

char * srf_FilePath = "ReadFile_002.txt";

It is too boring. So I want to make it more reliable to use. I want to add a browse button(I think that is the correct word, which is used to find the file in Windows) and set it as the file which I want to read.

How can I do it. Can you guys explain.

10 Years
Discussion Span
Last Post by eranga262154
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.