PRB: VBFireEvent Fails When MsgBox Displaying or DDE Occurring

Last reviewed: June 21, 1995
Article ID: Q126219
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,
  versions 2.0 and 3.0

SYMPTOMS

A Visual Basic event will not fire if a Visual Basic MsgBox is showing or if a form is waiting for a response after making a request during a DDE transaction.

RESOLUTION

In a custom control when the return value from VBFireEvent is EVENTNOTFIRED (0x7FFF), you can set a timer and attempt to refire the event from the timer until it is successful -- that is, until the user closes the MsgBox or the DDE request is finished processing.

A better alternative is to use PostMessage to send the same message back to the control. When messages are once again processed, this message will trigger the VBFireEvent again.

Another option for the MsgBox problem is to advise the user of your control to call the Windows API function MessageBox() instead of using the Visual Basic MsgBox statement. Events will still fire if a Windows API MessageBox() is displayed.

STATUS

This behavior is by design.


Additional reference words: 1.00 2.00 3.00
KBCategory: kbprg kbinterop kbprb
KBSubcategory: IAPDDE PrgCtrlsCus


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.