CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Posts
    10

    problems with MapViewOfFile

    the code :
    short* sig = (short * ) MapViewOfFile (hCubeMapping,
    FILE_MAP_COPY,
    offset >> 32,
    offset,
    size);
    works perfectly when offset = 0, but fails when offset is greater. I know that the offset must be a multiple of the allocation granularity (64K), but it returns NULL in any case. Please, help me to solve this problem


  2. #2
    Join Date
    Apr 1999
    Location
    Alabama, USA
    Posts
    261

    Re: problems with MapViewOfFile

    Perhaps the problem is in your use of the Bitwise shift operator. I suspect that the dwFileOffsetHigh and dwFileOffsetLow aren't being set correctly. I think it works when offset is 0 because bit-shifting zero is still zero, however when you use a non-zero offset, the bitwise math is probably incorrect.

    Good Luck.
    John




Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured