Microsoft KB Archive/187716

= DOC: Incorrect API Text Viewer Declaration of GetVersionEx API =

Article ID: 187716

Article Last Modified on 6/28/2004

-

APPLIES TO


 * Microsoft Visual Basic 5.0 Learning Edition
 * Microsoft Visual Basic 6.0 Learning Edition
 * Microsoft Visual Basic 5.0 Professional Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 5.0 Enterprise Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition
 * Microsoft Visual Basic 4.0 Standard Edition
 * Microsoft Visual Basic 4.0 Professional Edition
 * Microsoft Visual Basic 4.0 32-Bit Enterprise Edition

-



This article was previously published under Q187716



SUMMARY
The following error occurs when you use the GetVersionEx API function declaration from the API Text Viewer.

Compiler Error: User defined type may not be passed ByVal



MORE INFORMATION
The Declare statement for GetVersionEx in the API Text Viewer incorrectly passes a user-defined data type using the ByVal keyword. To correct this problem, remove the ByVal modifier. The correct declaration is: Private Declare Function GetVersionEx Lib "kernel32" Alias _ "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long You can also change the statement in the file win32api.txt so the next time you use the API Text Viewer, the Declare statement will be correct.



STATUS
This documentation error has been fixed in Visual Basic 6.0.

The win32api.txt that ships with Visual Basic version 6.0 has been updated with the correct declaration for GetVersionEx.

Additional query words: kbAPI kbVBp400bug kbVBp500bug kbDSupport kbDSD kbVBp600fix

Keywords: KB187716

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.