Programmatically copying a folder in MFC
-
Hi, I need to know how to copy a folder and all the contents within to another location set by the user. Because the folders content is read only, I want to be able to make ReadOnly(FALSE); Is this possible, please help! Thanks in advance Ashman
SHFileOperation will help out, its very good api to work around with files and folder.
"When death smiles at you, only thing you can do is smile back at it" - Russel Crowe (Gladiator)
-
SHFileOperation will help out, its very good api to work around with files and folder.
"When death smiles at you, only thing you can do is smile back at it" - Russel Crowe (Gladiator)
Thanks I searched for SHFileOperation() API calls and I don't understand how to implement it in my program. Do you have/know of an example that I can use. What I want to do is very basic; transfer 2 folders with all their files intact from location: D:\Programming\NeriedPOS\nbsSetup\nPOS & D:\Programming\NeriedPOS\nbsSetup\nManager to C:\Program Files\nPOS with ReadOnly(FALSE) Would you kindly be able to show me how to do that using SHFileOperation() or any other API? Please help...its kinda urgent considering I have almost run out of hair to pull :) Thanks Ashman
-
Thanks I searched for SHFileOperation() API calls and I don't understand how to implement it in my program. Do you have/know of an example that I can use. What I want to do is very basic; transfer 2 folders with all their files intact from location: D:\Programming\NeriedPOS\nbsSetup\nPOS & D:\Programming\NeriedPOS\nbsSetup\nManager to C:\Program Files\nPOS with ReadOnly(FALSE) Would you kindly be able to show me how to do that using SHFileOperation() or any other API? Please help...its kinda urgent considering I have almost run out of hair to pull :) Thanks Ashman
This
SHFILEOPSTRUCT shfo = {0};
shfo.wFunc = FO_COPY;
shfo.pFrom = "D:\\Programming\\NeriedPOS\\nbsSetup\\nPOS\\*.*\0";
shfo.pTo = "C:\\Program Files\\nPOS\0";
SHFileOperation(&shfo);should get you started.
A rich person is not the one who has the most, but the one that needs the least.
-
This
SHFILEOPSTRUCT shfo = {0};
shfo.wFunc = FO_COPY;
shfo.pFrom = "D:\\Programming\\NeriedPOS\\nbsSetup\\nPOS\\*.*\0";
shfo.pTo = "C:\\Program Files\\nPOS\0";
SHFileOperation(&shfo);should get you started.
A rich person is not the one who has the most, but the one that needs the least.
-
Ashman wrote: Thanks heaps You're welcome stacks!
A rich person is not the one who has the most, but the one that needs the least.