FIX: VB Registry Functions Are Limited with Nested Settings (149038)
The information in this article applies to:
- Microsoft Visual Basic Standard Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition, 16-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 16-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 32-bit, for Windows 4.0
This article was previously published under Q149038 SYMPTOMS
Error 5 - Invalid Procedure Call appears when the DeleteSetting is
attempted.
CAUSE
The SaveSetting statement and GetSetting function in Visual Basic 4.0 for
Windows are used to create and retrieve information from nested levels in
the Registry. However, the related DeleteSetting statement does not handle
these nested settings. The GetAllSettings function also has this
limitation.
RESOLUTION
Use more than one DeleteSetting statement to remove sections of the nested
keys before removing the top level key, rather than attempting to remove
the top key in isolation.
For example, in the following, do not use:
DeleteSetting "Test1"
Instead, use the following two lines of code to remove the Test1 key and
its subkeys:
DeleteSetting "Test1\Test2"
DeleteSetting "Test1"
To enable all possible functionality, you can use the Registry API
functions to perform any desired operation manually.
For more information on the Registry API functions, please see the
following article in the Microsoft Knowledge Base:
145679
: How to Use the Registry API to Save and Retrieve Setting
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This bug has been fixed in Visual Basic
6.0.
Modification Type: | Major | Last Reviewed: | 6/24/2004 |
---|
Keywords: | kbBug kbfix kbVBp600fix KB149038 |
---|
|