locked
CreateFileMapping RRS feed

  • Question

  • I have a file on my windows mobile phone. It's 200Mbyte. I'm using CreateFileMapping function on it. The code is working on some devices. Others gives me error code 6. (invalid_handle)

    when i reduced the file from 200Mbyte to 20Mbyte, it starts to working..

    What is problem?

    regards,


    SD
    Tuesday, April 13, 2010 2:23 PM

Answers

  • Hi SD,

     Please try to call CreateFileForMapping method before CreateFileMapping. This function creates or opens a file that can be used for memory mapping.

    CreateFileForMapping is basically a special version of CreateFile that you'd use for opening a file handle that you'd then pass to
    CreateFileMapping. If you need to create a mapping with an actual file,  use CreateFileForMapping and then CreateFileMapping.

    If this is not the case, please let me know.

     

    Best regards,
    Guang-Ming Bian - MSFT


    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    Thursday, April 15, 2010 10:46 AM