Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Handling files larger than 4GB

Handling files larger than 4GB

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    William Engberts
    wrote on last edited by
    #1

    Hi all, I am trying to work with video files larger than 6GB. The MFC file classes use DWORD's for position and length, which limits them to 4GB. I knwo there are equivalents for routines like CFileFind::GetLength or CFile::GetPosition, etc. but I can't seem to find them. Does anyone have an idea? Thanks in advance. William

    N R E 3 Replies Last reply
    0
    • W William Engberts

      Hi all, I am trying to work with video files larger than 6GB. The MFC file classes use DWORD's for position and length, which limits them to 4GB. I knwo there are equivalents for routines like CFileFind::GetLength or CFile::GetPosition, etc. but I can't seem to find them. Does anyone have an idea? Thanks in advance. William

      N Offline
      N Offline
      Naveen
      wrote on last edited by
      #2

      William Engberts wrote:

      CFileFind::GetLength or CFile::GetPosition, etc

      U can use the API's directly. GetFileSizeEx() SetFilePointerEx()

      nave [OpenedFileFinder]

      1 Reply Last reply
      0
      • W William Engberts

        Hi all, I am trying to work with video files larger than 6GB. The MFC file classes use DWORD's for position and length, which limits them to 4GB. I knwo there are equivalents for routines like CFileFind::GetLength or CFile::GetPosition, etc. but I can't seem to find them. Does anyone have an idea? Thanks in advance. William

        R Offline
        R Offline
        RChin
        wrote on last edited by
        #3

        Not sure what version of VS you are using, but the file handing classes in the MFC (CFile etc) were updated to handle large file sizes. So the CFile::GetPosition() now returns a ULONGLONG, Seek() has a LONGLONG parameter...and so forth. I now about the file limitation for VS6, but for the MFC 7.0 (VS7.1), these were updated.


        I Dream of Absolute Zero

        1 Reply Last reply
        0
        • W William Engberts

          Hi all, I am trying to work with video files larger than 6GB. The MFC file classes use DWORD's for position and length, which limits them to 4GB. I knwo there are equivalents for routines like CFileFind::GetLength or CFile::GetPosition, etc. but I can't seem to find them. Does anyone have an idea? Thanks in advance. William

          E Offline
          E Offline
          eraccn
          wrote on last edited by
          #4

          you may use CreateFileMapping and ViewMapOfFile to map such files into your process address,__int64 will be ok. DWORD dwFileLo = ::GetFileSize(hFile,dwFileHi); ASSERT(dwFileLo != INVALID_FILE_SIZE); __int64 qwFileSize = dwFileHi << 32 | (dwFileLo & 0XFFFFFFFF);

          Later buggers harm more.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups