1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Total newbie - deciding on which kernel32 functions to use to copy a file.

Discussion in 'MFC' started by Cheesysocks, Sep 9, 2010.

  1. Cheesysocks

    Cheesysocks New Member

    Sep 9, 2010
    Likes Received:
    Trophy Points:
    Good afternoon all.

    I'm new here, so greetings one and all.

    There is a long story behind this post which I shall give if asked, but to keep things simple can anyone help me with the following?

    I need to call some Kernal32.dll functions from a language called MapBasic. (By Pitney Bowles and it'a a part of a mapping / GIS program called MapInfoPro. MapBasic doesn't have a file copying feature built in.)

    The job I wish to do is to get an image from a remove server and create a copy of it in a local directory. Which functions do I need to call to do this please?

    I need to:

    Loop many, many times
    Copy it from the server to local memory. (On a slow connection if this info helps)
    Copy it from local memory to the destination folder on the same machine.
    Remove the file from local memory.

    I need to read a return value and wait until the transfer is complete before continuing with the next iteration of the loop.

    I see the function CopyFile or CopyFileEx, but it has no way to reference a path, so I assume it creates a copy of an existing file with a new name in memory.

    Is CreateFile the way to go or is there more for me to know? Many thanks in advance.


Share This Page