You are currently offline, waiting for your internet to reconnect

How To Handle OLE Automation Server Timeout and Synchronization

This article was previously published under Q138066
There are seven properties of the App object that allow you to handle thetiming and synchronization of OLE calls made from a Visual Basic client toan OLE automation server:

Client calls to methods or properties on OLE Automation Servers aresynchronous; that is, the calls do not return until the particularprocedure has finished. This might be an issue if a particular call takesso long that the user starts clicking the mouse or pressing the keyboard toelicit some response. The user may then falsely conclude that theapplication is not working when, in fact, it is only busy. This situationmight appear even more confusing when the OLE Automation server isinvisible. Under such circumstances, OLE brings up a dialog box displayinga cryptic message that the server is busy.

The OLERequestPendingMsgText and OLERequestPendingMsgTitle properties canbe used to customize the message actually displayed under thesecircumstances to better reflect the actual situation, and the length oftime after which the message will be displayed can be controlled by theOLERequestPendingTimeout property.

A similar message will be displayed when the OLE server rejects an OLEAutomation request from a client. The client will keep trying until thenumber of milliseconds specified in the OLEServerBusyTimeOut property haselapsed. The OLEServerBusyMsgText and OLEServerBusyMsgTitle propertiesallow you to customize the actual messages displayed.

The OLEServerBusyRaiseError property determines whether a rejected OLEAutomation request raises an error instead of displaying a "busy" message.Raising an error when an OLE server rejects an OLE Automation requestreturns control to your program, which allows you to provide your owncustom dialog box in place of either the default Server Busy dialog box orthe customized busy message. The OLE Automation error that will be raisedis -2147418111 (&h80010001)

The App object implements these properties by supporting the IMessageFilterOLE interface. Please refer to the OLE Programmer's Reference for moredetails on this interface.
kbVBp400 kbVBp500 kbVBp600 kbVBp kbdsd kbDSupport kbAutomation kbInterop kbOLE

Article ID: 138066 - Last Review: 07/01/2004 16:56:00 - Revision: 2.1

  • Microsoft Visual Basic 6.0 Learning Edition
  • Microsoft Visual Basic 6.0 Professional Edition
  • Microsoft Visual Basic 6.0 Enterprise Edition
  • Microsoft Visual Basic 5.0 Professional Edition
  • Microsoft Visual Basic 5.0 Enterprise Edition
  • Microsoft Visual Basic 4.0 Standard Edition
  • Microsoft Visual Basic 4.0 Professional Edition
  • Microsoft Visual Basic 4.0 Professional Edition
  • Microsoft Visual Basic 4.0 16-bit Enterprise Edition
  • Microsoft Visual Basic 4.0 32-Bit Enterprise Edition
  • kbhowto kbgrpdsvb KB138066