PRB: VBFireEvent Fails When MsgBox Displaying or DDE Occurring (126219)



The information in this article applies to:

  • Microsoft Visual Basic Standard Edition for Windows 1.0
  • Microsoft Professional Toolkit for Microsoft Visual Basic programming system for Windows
  • Microsoft Visual Basic Professional Edition for Windows 2.0
  • Microsoft Visual Basic Professional Edition for Windows 3.0

This article was previously published under Q126219

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.

Modification Type:MinorLast Reviewed:8/16/2005
Keywords:kbprb KB126219