| NSwiftae (5) | ||||
Alright so I'm just trying to figure out how to use the CopyFile() function in C++. So far I can't figure out any of it. What I'm running is:
It seems to run fine, but nothing ever gets copied. The debug info is:
| ||||
|
Last edited on
|
||||
| EssGeEich (1009) | |||
Try:
Tell us which value does Error have then. It can also be that there is already a file in C:\Program Files named Argh.log and it fails. If you don't want it to fail change the ending '1' to '0' (you should). | |||
|
|
|||
| guestgulkan (2916) | |
|
Also C:\program files directory may be one of those 'special' locations that need admininstrator rights to be able to create files directly. | |
|
|
|
| NSwiftae (5) | |
Nothing seems to be different with your build. I don't thinkDWORD Error = GetLastError();did anything? If I add in cout<<Error<<endl;though, I get '5', and I have no idea what it means? I'm still a beginner... | |
|
|
|
| guestgulkan (2916) | |
|
Look here: http://msdn.microsoft.com/en-gb/library/windows/desktop/ms681382%28v=vs.85%29.aspx Look down the page. Error code 5 is ERROR_ACCESS_DENIED Check my earlier post (of about 30 minutes ago) | |
|
Last edited on
|
|
| EssGeEich (1009) | |
| Yes, what I wanted was that '5' number and guestgulkan is right - You need admin privileges for Vista and 7 to access those folders. | |
|
|
|
| modoran (1245) | |
| That means you have to run Visual Studio as administrator, as you seem to debug your program. | |
|
|
|
| NSwiftae (5) | |
| YES! I just ran it as administrator and it is working fine! Thank you so much everyone! | |
|
|
|