Microsoft KB Archive/126219

From BetaArchive Wiki
Knowledge Base


PRB: VBFireEvent Fails When MsgBox Displaying or DDE Occurring

Article ID: 126219

Article Last Modified on 2/23/2007



APPLIES TO

  • Microsoft Visual Basic 1.0 Standard Edition
  • Microsoft Windows 2000 Readiness Analyzer
  • Microsoft Visual Basic 2.0 Professional Edition
  • Microsoft Visual Basic 3.0 Professional Edition



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.


Additional query words: 1.00 2.00 3.00

Keywords: kbprb KB126219