08-12-2005 07:57 AM
08-12-2005 03:05 PM
Hello NicoP,
In order to use the CopyFile to save to a network location, you can first map that location to a drive on your machine (My Computer >> Tools >> Map Network Drive). Then in the CopyFile function you would pass the mapped drive as one of the parameters, and it should successfully copy you file over to the remote location.
Before:
CopyFile("c:\\test.txt", "\\\remote\\test.txt"); returns a -5 error.
After
CopyFile("c:\\test.txt", "y:\\test.txt"); where Y: is mapped to \\remote.
Hope that helps.
08-16-2005 01:09 AM
08-16-2005 11:34 AM
08-16-2005 02:15 PM
Hello NicoP,
I ran the following code on my machine, and it worked as expected:
#include <utility.h>
#include <cvirte.h>
int main (int argc, char *argv[])
{
if (InitCVIRTE (0, argv, 0) == 0)
return -1; /* out of memory */
CopyFile ("c:\\test.txt", "z:\\test.txt");
return 0;
}
I would double check the write permissions on your network drive to see if it allows files to be created remotely.
Thanks.
08-22-2005 04:03 AM
Hello,
I agree with Wendy. I made some tests and everything works as expected. I suggest you to test with another network ressource and with another PC.
Regards,
08-22-2005 04:31 AM