The information in this article applies to:
SYMPTOMSThe return value of the VBSetVariantValue function in the VBAPI library has changed in the 16-bit version of Microsoft Visual Basic version 4.0. This change in behavior affects 16-bit DLLs and custom controls (VBXs) that previously worked with Microsoft Visual Basic version 3.0. MORE INFORMATIONThe documentation for the VBSetVariantValue function in the Control Development Guide in the Professional Edition of Microsoft Visual Basic states that when this function is used with the documented VB_<type> types, a -1 value is returned for errors, and 0 is returned for success. This statement is no longer true for DLLs and custom controls (VBXs) used with Visual Basic 4.0. The VBSetVariantValue function returns -1 for errors, 0 or greater for success. STATUSMicrosoft has confirmed this to be a issue in the 16-bit version of Visual Basic for Windows version 4.0. We are researching this issue and will post new information here in the Microsoft Knowledge Base as it becomes available. RESOLUTIONTo indicate success, change the DLL or VBX source code to handle return values of 0 or greater, instead of equivalence to 0. For example, if you have code that resembles the following:
A DLL or VBX that contains this function correctly returns SUCCESS when
used from a Visual Basic version 3.0 program. When the same DLL or VBX is
used from a Visual Basic version 4.0 program, it incorrectly returns
FAIL.
You can avoid this problem by changing the line:
to
-OR-
you can test for a failure only. For example:
Additional query words: kbVBp400bug kbVBp kbdsd kbDSupport kbUsage
Keywords : kbGrpVB |
Last Reviewed: February 2, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |