从C ++设置OLE请求超时 [英] Set OLE Request Timeout from C++
问题描述
我使用CoCreateInstance实例化本地COM服务器。有时,提供服务器的应用程序需要很长时间才能启动。发生这种情况时,Windows会弹出如下对话框:
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:
服务器忙
由于其他程序正忙,无法完成操作。
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]
我发现在Application对象上提供了一个Visual Basic属性,OleRequestPendingTimeout,可以用来控制此对话框出现之前的时间。我找不到任何良好的文档或从C ++有用的等价物。
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?
推荐答案
如果你使用的是MFC,我们以前做过这样的事情: / p>
If you're using MFC, we used to do stuff like this:
// prevent the damned "Server Busy" dialog.
AfxOleGetMessageFilter()->EnableBusyDialog(0);
AfxOleGetMessageFilter()->EnableNotRespondingDialog(0);
这篇关于从C ++设置OLE请求超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!