Registry Key LOCKED? What the ?????
Posted on 2005-05-05
Hello Experts, here’s hoping someone out there has already gone though this problem and found a solution. It’s kind of a strange issue so I will do my best to describe it. The simplest way to describe it would be that the registry just LOCKS the key that my program is trying to access. Or maybe its vise versa and my program locks the Registry Key, I just don’t know.
Here is a run down. I am developing in Visual Basic 6. Inside my app I have a timer that goes off in X minute intervals where X can be defined by the user of the program. The program then reads a value which happens to be a website URL from the registry. This URL may also be changed by the user (but anyway that’s probably not important). Ok so the app works great, and reads from the registry, but then when you come back to the computer a few days later its like the registry key is completely locked. My app has generated an error that it can not read from the registry. To rule out a false error message I opened RegEdit.exe and navigate to the key in question. It is indeed LOCKED.
As soon as I try to click on the key using RegEdit.exe I get this error message:
“Cannot Open KeyName: Error while opening key”
I have checked permissions on the key and they are set properly, but it’s not a permission issue because the app works find for a few days before the key becomes locked.
Ok so the solution to unlocking they key is to close the App that I programmed and re-open it. Once I do that RegEdit.exe can access the key, and my app is also able to access the key for another couple days.
So my questions are…. What is locking the key? Why is the key locking, and why does it happen for no apparent reason after a few days. Even the timing on it is not consistent.
Please someone help!