[python-win32] win32com: ServerBusy message (original) (raw)
mauro tizianel mauro.tiz at gmail.com
Tue Jan 29 18:09:11 CET 2008
- Previous message: [python-win32] Character sets and symbols question
- Next message: [python-win32] win32com: ServerBusy message
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi list,
I am calling a method on a COM server within a python script. The method takes a long time to return ( > 15s) and I am getting a "Server Busy" popup message "This action cannot be completed because the program is busy." To continue the user has to click ( "Switch to..." or "Retry").
Typing in the command-line window:
from win32com.client import Dispatch myComObj = Dispatch("myApp.Application") anotherComObj = myComObj.method() res = anotherComObj.thisIsAVeryLongOperation()
everything works fine (no popup message, thisIsAVeryLongOperation returning without user interaction) but if I put it into a file and run it as a script the message appears: why?
I tried to get rid of the popup with the solution proposed in http://mail.python.org/pipermail/python-win32/2006-August/004923.html
import win32ui import win32uiole from win32com.client import Dispatch
win32uiole.AfxOleInit() win32uiole.SetMessagePendingDelay(aBigDelay); win32uiole.EnableNotRespondingDialog(False); win32uiole.EnableBusyDialog(False);
myComObj = Dispatch("myApp.Application") anotherComObj = myComObj.method() res = anotherComObj.thisIsAVeryLongOperation()
without any effect.
pythoncom.CoInitialize() should also work, as suggested in http://support.microsoft.com/?scid=kb%3Ben-us%3B248019&x=14&y=15, but again no positive effect.
I was now looking for something like ( http://support.microsoft.com/kb/240809/en-us): OLERequestPendingTimeout to turn off the messages, but it seems not to be available in pywin32.
By the way, I am running:
Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] pywin32-210.win32-py2.4 WinXP SP2
Thanks in advance. Any suggestion is welcome!
Mauro -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-win32/attachments/20080129/33e1fd54/attachment.htm
- Previous message: [python-win32] Character sets and symbols question
- Next message: [python-win32] win32com: ServerBusy message
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]