|
no
|
|
|
|
|
Can you rename file and then delete it?
|
|
|
|
|
No I am not able to delete it even after renaming...
|
|
|
|
|
Did you check close threads or susped threads of that process?
|
|
|
|
|
Hamid. wrote: Did you check close threads or susped threads of that process?
Terminating the thread of that process is no possible. Also I dont know which thread of the process opened that handle. BTW do you think the file handle have any relation with the thread created it?
|
|
|
|
|
I guess yeah(but not sure) I saw this case with Explorer(I think it has 57 threads) on the XP and also Im agree with you its not safe way to terminate threads but when you told that you could to closehandle but you cant delete file.
|
|
|
|
|
Hamid. wrote: I guess yeah(but not sure) I saw this case with Explorer(I think it has 57 threads) on the XP and
I would like to know more about this. You mean you have faced secnario like "Renaming is possible but deletion is not possible" with explorer?
|
|
|
|
|
I am also facing a situation same as you,need to delete a
file which is locked by another process.
But still do not know the solution.
For your reference,he is the code to do this,but this application is
also not very successful on deleting.
http://sourceforge.net/project/showfiles.php?group_id=151239[^]
In my case I need to delete the locked file,and again create it using
a Linker(ILINK32.exe) to produce a DLL.
Even when using Unlocker to delete the file,it is not possible
to create the same file.The linker gives me error like
"Cannot release virtual memory at addr xxxx for xxxxx bytes".
|
|
|
|
|
|
It returns to 2 or 3 years ago when I tried to monitor and control my system I saw we have a lot of detaily on the memory and memory of processes for example I deleted all threads of Explorer except a thread ot two threads of it but it works without problem I tried to
copy/move/paste/open new window and other actions but it doesnt show me any error but when I deleted a thread of it then it finished,it was like when you close it of Task manager ,But your ptoblem is like when you want to close some processes that are depedns to an antivirus you cant delete then until you inactive anitivirus,but I have a suggestion for you you cant test this action on your system (and answer is determined because its harmful for your system) but you can test your program on the virtual PC with a OS.
|
|
|
|
|
Thanks for the information. Any how I cannot do this because, I dont know which thread of the application opened the file.
|
|
|
|
|
Before deleting the file,try using
<br />
SetFileAttributes(FileName,FILE_SHARE_DELETE);<br />
|
|
|
|
|
poda wrote: SetFileAttributes(FileName,FILE_SHARE_DELETE);
FILE_SHARE_DELETE is used along with the CreateFile() API. It cannot be used in SetFileAttributes() function.
|
|
|
|
|
I hope you find the answer,early.
|
|
|
|
|
|
|
Looking for activex controls to activate on CEdit controls and more for touch screen computer development. Some of our customer's tablets are XP Pro passive touch and some others are XP Tablet. Would like user ablity not to go to keyboard or rely on the virtual embedded keyboard. For example, if needing to enter numeric values allow activation of control by entering the CEdit or by even a button beside the CEdit control. This would allow current and new method. At that time, we would have the ability to allow the user to enter in numeric values and/or maybe even having a way to calculate. At that time, the number can be sent to the CEdit control.
Working still in VC 6++ and would need activex
thanks
|
|
|
|
|
I have a variable that contain 1.#QNAN00000000000.
Is it possible to tell to the VS2005 debugger to pause the application when NAN (or INF...) happens?
(to know, without step every instruction of the program, where is the problem)
Russell
|
|
|
|
|
You can do something like this in debug mode using _isnan()[^] and DebugBreak()[^]:
if(TRUE == _isnan(*dMyVal))
{
DebugBreak();
}
for non-MFC you could do something like this using interrupt 3[^]:
if(TRUE == _isnan(*dMyVal))
{
__asm
{
int 3;
}
}
To check for both infinity and NaN at the same time you could do this:
__inline bool IsInfinifyOrNan(const double& n)
{
return (*((unsigned*)&n + 1) & 0x7FF00000) == 0x7FF00000;
}
if(TRUE == IsInfinifyOrNan(dMyVal)
{
__asm
{
int 3;
}
}
Best Wishes,
-David Delaune
|
|
|
|
|
You should never check for "TRUE == foo()". You need to check for either "FALSE != foo()" or just "foo()" if foo() returns a nonzero value on success.
You would be amazed how many times I've seen this construct result in unexpected behaviour.
|
|
|
|
|
Thanks for the tip. You are correct for _isnan() in that the documentation states:
_isnan returns a nonzero value if the argument x is a NAN
I falsely assumed it was returning a BOOL when I wrote my comment.
Thanks again,
-David Delaune
|
|
|
|
|
Hi All,
We have custom side bar on our IE, I want to disable sidebar close(x) button on my browser, It is placing lefe side of the window and it is not main close button for IE.
Thanks in Advance
ashok
|
|
|
|
|
Hi,
I have a need to use Thread Local Storage but not in the way thats documented (MSDN)
from the documentation a DWORD tlsindex is allocated when during a PROCESS_ATTACH message in the DLL..... tlsindex = TlsAlloc() there after every thread in the process
using this DWORD
I personally have yet to get this to work so I am guessing that everytime you do a TlsSetValue withis dword index it bumps up the number so when you subsequently do TlsGetValue you get the pointer associated with this number
Doesn't seem to have anyting to do with a thread where the actual pointer has something to do with stack (the stack being the local storage of the thread)
If I misunderstanding now the TLS Api's work I would be greatly appreictive if someone set me striaght
|
|
|
|
|
ForNow wrote: I am guessing that everytime you do a TlsSetValue withis dword index it bumps up the number
Huh? Bumps up what number?
The index is global - it is the same for ALL threads in the process.
What a given thread puts in the slot (designated by the index) is local to the given thread.
These may help:
Thread Local Storage[^]
Using Thread Local Storage in a Dynamic-Link Library[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Okay then my question is can I set A value for a Thread that is not the Current Thread
After I create My Thread Control does automatically transfer to the DLL_THREAD_ATTACH message
I have at that point a thread id for the the thread for which I wish to do a TLSetValue
is is this do-able ????
I would like to inform The DLL_THREAD_ATTACH message the nature of the thread like Set pointer via TlSsetValue
and have the DLL reterive it With TlsGetValue as my DLL is acting as a kind of server to the threads of the process and
it would be helpfull to know what the nature of the thread is
|
|
|
|