Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set OLE Request Timeout from C++

Tags:

c++

com

ole

I am instantiating a local COM server using CoCreateInstance. Sometimes the application providing the server takes a long time to start. When this happens, Windows pops a dialog box like this:

Server Busy

The action cannot be completed because the other program is busy. Choose 'Switch To' to activate the busy program and correct the problem.

[Switch To...] [Retry] [Cancel]

I have found mention of a Visual Basic property on the Application object, OleRequestPendingTimeout, that can be used to control the time before this dialog comes up. I can't find any good documentation on this or an equivalent that is useful from C++. Can anyone point me in the right direction?

like image 835
J. Loomis Avatar asked Nov 11 '08 20:11

J. Loomis


1 Answers

If you're using MFC, we used to do stuff like this:

// prevent the damned "Server Busy" dialog.
AfxOleGetMessageFilter()->EnableBusyDialog(0);
AfxOleGetMessageFilter()->EnableNotRespondingDialog(0); 
like image 186
John Dibling Avatar answered Sep 18 '22 11:09

John Dibling