PRB: VBFireEvent Fails When MsgBox Displaying or DDE Occurring

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
  • Microsoft Visual Basic Professional Edition for Windows, versions 2.0, 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 query words: 1.00 2.00 3.00

Keywords :
Version :
Platform :
Issue type :


Last Reviewed: September 17, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.