|
Post by Craig on Sept 14, 2005 14:57:05 GMT -5
Hi, I was doing some testing using your Registry class, and am running into a rather major problem -- if the registry key path provided doesn't exist, VB crashes hard. For the time being I am able to circumvent the problem by creating the key first, but I would prefer to note the lack of existence before creating it. I was able to replicate the problem using the test code on the doc page for the RegistryKey class (adding "\Blah" to the end of the path in the example). It also crashes on me if I use the OpenSubKey method on a RegistryKey and the key path doesn't exist.
Below is my system info, if you're curious.
Thanks, Craig ----------------------------------------------------------------- Kernel version: Microsoft Windows 2000, Uniprocessor Free Product type: Professional Product version: 5.0 Service pack: 4 Kernel build number: 2195
From the VB About Dialog: --------------------------------- VB 6.0 SP5, Version 8988, VBA: Retail 6.0.8964, Forms3: 2.01
Thanks, Craig
|
|
|
Post by Kelly Ethridge on Sept 14, 2005 19:31:05 GMT -5
Hello,
Does this happen when you're exiting a compiled application only?
|
|
|
Post by Craig on Sept 15, 2005 9:34:14 GMT -5
Nope, happens in the debugger stepping over a single line of code. I have version 1.5.3 of vbcorlib assuming the install file I downloaded is accurate in its name. The Create/Open works fine...just the Open of the non-existent key crashes the program and the VB DE.
Thanks for the quick reply... Craig
|
|
|
Post by Kelly Ethridge on Sept 15, 2005 12:24:18 GMT -5
Ok, which line of code?
I'm stepping over the example in the docs with the appended '\blah'. I do get Error 91 as expected when I try to use the 'rk' variable after attempting to retrieve the missing key. Which line of the example would you crash on?
Kelly
|
|
|
Post by Craig on Sept 15, 2005 14:20:07 GMT -5
Hi Kelly, I put a comment in the code from your example below. I can send you a screenshot of the crash dialog, and the project if you'd like; since it apparently is not a general bug.
Thanks, Craig ------------------------------------------------------------------- Public Sub Main() Dim rk As RegistryKey Dim names() As String Dim i As Long
' Open a registry subkey for enumeration. ' Line directly below causes VB to crash Set rk = Registry.LocalMachine.OpenSubKey("software\microsoft\windows\currentversion\run\nonexistent")
' Retrieve all names for the values in the key. names = rk.GetValueNames
' enumerate the names and get the value for each, ' displaying the pair as [name] = [value]. For i = 0 To UBound(names) Console.WriteLine "{0} = {1}", names(i), rk.GetValue(names(i)) Next i
' Close the registry key. rk.CloseKey
' Wait for user to hit return. Console.ReadLine End Sub
|
|
|
Post by Kelly Ethridge on Sept 15, 2005 19:45:56 GMT -5
Hello,
Ok, I can't reproduce the problem. Where did you get your version of VBCorLib? And was it the compiled version or did you compile it yourself?
Maybe you can send me your version of VBCorLib.
|
|
|
Post by CraigM on Sept 22, 2005 16:08:51 GMT -5
Sorry about the delay..I thought I had posted a reply but I guess the issues with my login (registration still not approved) may have prevented it from actually posting?
I downloaded it from one of the sourceforge mirrors...the info on the downloaded file is:
1,816,558 VBCorLibInstall_v1_5_3.exe Sum: 47577 1774
For the actual VBCorLib.dll file:
File Version: 1.5.0.3 Product Version: 1.05.003 Size: 2.51 MB (2,633,832 bytes) Modified: Sunday, August 21, 2005, 8:41:02 PM Sum: 06590 2573
Thanks, Craig
|
|
|
Post by Kelly Ethridge on Sept 22, 2005 17:29:25 GMT -5
Hello, No worries about the delay. I have finally found a computer that has the same problem as you. I've fixed it and will release another minor update. Nothing else will have changed. In the meantime, I am including a link directly to the DLL if you'd like to just drop this replacement in. Just replace the other dll and you will be fine. www.kellyethridge.com/vbcorlib/VBCorLib.dllThis will fix your problem. Sorry about the inconvenience. Kelly
|
|
|
Post by CraigM on Sept 23, 2005 9:29:21 GMT -5
Great, thanks for looking into it. I'll give it a try and let you know that all is Ok.
|
|