Call VBSetErrorMessage() In Response to VBM_ Messages Only

Last reviewed: June 21, 1995
Article ID: Q80403
The information in this article applies to:

- Microsoft Visual Basic Control Development Kit (CDK) for Microsoft

  Visual Basic Programming system for Windows, version 1.0
- Microsoft Professional Toolkit for Microsoft Visual Basic, version 1.0 - Professional Edition of Microsoft Visual Basic for Windows, version 2.0

SYMPTOMS

The Visual Basic Control Development Kit (CDK) API function VBSetErrorMessage() operates correctly only when called in response to a VBM_ message, such as VBM_SETPROPERTY.

STATUS

This behavior is by design.

MORE INFORMATION

The VBSetErrorMessage() function can be called from a custom control in response to a VBM_ message to pass an error number and message back to Visual Basic. When execution returns to Visual Basic, a trappable run-time error will occur, with the error number and message specified in the call to VBSetErrorMessage.

The VBSetErrorMessage routine works only in response to messages that originate from Visual Basic itself (VBM_ messages). Visual Basic responds to the return code for VBM_ messages, and in turn sets the error condition in the program. If the return code for a VBM_ message is True, Visual Basic will generate an error condition. For other messages (non VBM_ messages), Visual Basic must pass along the return code to the originator of the message (usually Windows); therefore, Visual Basic will not generate an error condition for these messages.

REFERENCES

"Microsoft Visual Basic: Control Development Guide," (c) 1992, page 117 (shipped with Professional Toolkit)

"Microsoft Visual Basic: Control Development Guide," (c) 1991, page 108 (part no. 20666)


Additional reference words: docerr 1.00 2.00
KBCategory: kbtool kbprg kbdocerr
KBSubcategory: TlsCDK


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 21, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.