PRB: Run-time Error 87 Using RegEnumValue FunctionLast reviewed: December 22, 1997Article ID: Q173009 |
The information in this article applies to:
SYMPTOMSWhen attempting to call the RegEnumValue API from Visual Basic or Visual Basic for Applications code, you may receive the following error:
Error 87 - Invalid ParameterThis problem occurs if you are running the Windows NT 4.0 Operating System and you have obtained the declaration for the RegEnumValue API from Visual Basic's API Text Viewer program.
CAUSEThe Declare statement for RegEnumValue in Visual Basic's API Text Viewer is incorrect.
RESOLUTIONThe declaration of RegEnumValue as it currently exists in the API Text Viewer is:
Declare Function RegEnumValue Lib "advapi32.dll" Alias "RegEnumValueA" _ (ByVal hKey As Long, ByVal dwIndex As Long, ByVal lpValueName As _ String, lpcbValueName As Long, lpReserved As Long, lpType As Long, _ lpData As Any, lpcbData As Long) As LongThe fifth parameter, lpReserved, should be defined as ByVal. The correct declaration is:
Declare Function RegEnumValue Lib "advapi32.dll" Alias "RegEnumValueA" _ (ByVal hKey As Long, ByVal dwIndex As Long, ByVal lpValueName As _ String, lpcbValueName As Long, ByVal lpReserved As Long, lpType As _ Long, lpData As Any, lpcbData As Long) As Long STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
REFERENCESAn updated version of the Win32API.txt file is available for download for registered users of Visual Basic. For more information about downloading this file, please see the following Knowledge Base article:
ARTICLE-ID: Q178020 TITLE : FILE: WIN32API.EXE: Updated Version of Win32api32.txt File Keywords : vb432 VB4WIN vb5all Version : WINDOWS:4.0,5.0 Platform : NT WINDOWS Issue type : kbprb |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |