|
Did you try with SHFileOperation ?
|
|
|
|
|
No i have no idea about SHFileOperation..
Can you give me example..
Plz help me
|
|
|
|
|
ShFileOperation Demo[^]
The secret of life is not enjoyment
but education through experience.
- Swami Vivekananda.
|
|
|
|
|
Like this:
TCHAR m_Files[256];
sfo.wFunc = FO_COPY;
sfo.hwnd = NULL;
sfo.pFrom = m_Files;
sfo.pTo = "c:\\Pics";
sfo.fFlags = FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOCONFIRMMKDIR;
hr = SHFileOperation(&sfo);
|
|
|
|
|
vcprog wrote: The process cannot access the file because it is being used by another process.
Which part of this error message do you not understand?
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
yes you are right i am not understand where is error showing?Can you help me?
|
|
|
|
|
The error means that this particular file is being exclusively locked by another process. So, until that process would release this lock, you will not be able to copy this file. You may try copying some other file to verify this.
See if this[^] helps.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Sir it's not help me..Plz tell me how can i solve that problem..
Plz help me
|
|
|
|
|
|
There is no point in all that, because the problem is that the OP is trying to copy a file which is being exclusively locked by another process.
The problem is not in choosing the method to copy a file, but with copying the file itself, as it is locked.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Yeah thats right I forgot what was problem!
|
|
|
|
|
Hi Can i send you code.How can i attached the code here plz tell me or give me mail Id i will send you code..Plz help me
|
|
|
|
|
There is no problem with your code. The problem is, that the file is locked for copying. You may try copying some other file and see if that works first, to confirm what I say.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Sir how can i solve that problem.I need some vital help from forum side..
|
|
|
|
|
|
Hi Rajesh R Subramanian
I ask to Mr. toxcct but i havn't got any reply from toxcct side.
|
|
|
|
|
What did I ask you to do and what have you done?
"Hello sir plz i need help" Is that a query? Help you with what? Did you explain him the problem? Did you tell that you are facing a similar situation and you need help with exactly "this X thing"? It would be impossible to help you.
That, you've just posted it 2 hours back and you write to me because he hasn't replied? If you don't have the manners and social skills, there is zero chance of getting any help from a community.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Before any thing to say plz check all things.
Plz see it..
<a href="http://www.codeproject.com/script/Forums/View.aspx?fid=1647&msg=2738614">http:
|
|
|
|
|
You see, you don't know how to ask a question. I did see that post, it. You've made it before a 4 odd hours. So what? You can't wait for a day at least?
Fair enough - your' answer is with process explorer, download it and find out which process is having a handle on the file that you want to copy, release the handles and try copying the file. I won't write any further in this regard.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Thx's for reply i have download and how can i
find out which process is having a handle on the file that you want to copy
Plz help me
|
|
|
|
|
Run process explorer, click on "Find->Find handle or DLL" type your file name that your app is unable to copy there and hit search. The tool will now reveal the process that has locked your resource.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Whats the purpose of using the below statement with in _DEBUG
#ifdef _DEBUG
CString str;
#endif
VIBIN
"Fool's run away,where angle's fear to tread"
|
|
|
|
|
From the docs:
The compiler defines _DEBUG when you specify the /MTd or /MDd option. These options specify debug versions of the C run-time library.
If you want a piece of code to be executed only in debug mode, then you can use this.
vibindia wrote: #ifdef _DEBUG
CString str;
#endif
In this example of yours, this declaration for str will not happen in release mode (or, simply when /MTd or /MDd option is not specified).
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
yes, that's what it does, but effectively, it has no significant use...
|
|
|
|
|
toxcct wrote: yes, that's what it does, but effectively, it has no significant use...
Not the case with me. Some of my apps run for weeks together, and they follow different ways of logging and dumping data, based on how the dump functions are implemented, which in turn are based on the build. I use them extensively.
And I have no idea of why would you want to tell me that it is of no use. Probably you wanted to reply to the OP?
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|