I am newbie from Visual Studio C++. I am using CFileDialog to get the file name and file path from user input. and now i want to use progress control that is loading process and user have to wait depend on your input file size. Now I got the file name and file path by using CFileDialog but I don't know how to get a user input file size.
I am using below method and it always return zero.
int FileSize(const char * szFileName)
{
struct stat fileStat;
int err = stat(szFileName, &fileStat);
if (0 != err)
return 0;
return fileStat.st_size;
}
Please suggest me if you have a better solution to get a file size.
Thanks you very much.