- Sep 4, 2000
- 482
- 0
- 0
I'm trying to get the file size in the most kosher way and I read that this is the proper way to do it, although 4 GB files are rare I guess.
I get a warning : C:\DirListen\DirListener.cpp(98) : warning C4307: '+' : integral constant overflow
This is obviously because MAXWORD + 1 overflows the constant - but what exactly am I supposed to store it in that is bigger than a DWORD ?
void DirListener:
rocessFile(WIN32_FIND_DATA *info, const char* fullPath)
{
//std::cout << "Processed : "<< movedClassName << std::endl;
DWORD fileSize = 0;
fileSize = ((info->nFileSizeHigh * (MAXDWORD+1)) + info->nFileSizeLow);
}
I get a warning : C:\DirListen\DirListener.cpp(98) : warning C4307: '+' : integral constant overflow
This is obviously because MAXWORD + 1 overflows the constant - but what exactly am I supposed to store it in that is bigger than a DWORD ?
void DirListener:
{
//std::cout << "Processed : "<< movedClassName << std::endl;
DWORD fileSize = 0;
fileSize = ((info->nFileSizeHigh * (MAXDWORD+1)) + info->nFileSizeLow);
}