+ Reply to Thread
Results 1 to 3 of 3

Thread: How to get file size using WIN32 API?

  1. #1

    How to get file size using WIN32 API?

    How to get file size using WIN32 API? Is there any direct API available?

  2. #2
    Example:

    Code:
    LARGE_INTEGER GetMyFileSize(CString strFileName)
    {
    	LARGE_INTEGER nLargeInteger = { 0 } ;
    	HANDLE hFile = CreateFile(strFileName, GENERIC_READ, FILE_SHARE_READ, NULL,
    												OPEN_EXISTING, FILE_ATTRIBUTE_READONLY, NULL);
    	if (hFile != INVALID_HANDLE_VALUE)
    	{
    		BOOL bSuccess = GetFileSizeEx(hFile, &nLargeInteger) ;
    	}
    
    	return nLargeInteger ;
    }

  3. #3
    Thanks. That is what I wanted.

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts