WIN32OLE disable busy dialog etc

Hi,

I sometimes have a problem whereby during a long operation using
WIN32OLE, I get a message box, which says:

“This action cannot be completed because the other program is busy.
Choose switch to activate the busy program and correct the problem.”

This same problem was ran into, and a way to circumvent it added to the
python equivalent module. See
[python-win32] OLE Server Busy dialog box,
and the commit
CVS Info for project pywin32.

In essence, you just need to be able to get the current message filter,
and set some flags on it. Anyone know if its possible to do this using
Win32API or similar? I spent a bit on it and couldn’t figure it out.

Charles L. wrote:

Hi,

I sometimes have a problem whereby during a long operation using
WIN32OLE, I get a message box, which says:

“This action cannot be completed because the other program is busy.
Choose switch to activate the busy program and correct the problem.”

This same problem was ran into, and a way to circumvent it added to the
python equivalent module. See
http://mail.python.org/pipermail/python-win32/2006-August/004923.html,
and the commit
http://pywin32.cvs.sourceforge.net/pywin32/pywin32/Pythonwin/win32uiole.cpp?r1=1.5&r2=1.6.

In essence, you just need to be able to get the current message filter,
and set some flags on it. Anyone know if its possible to do this using
Win32API or similar? I spent a bit on it and couldn’t figure it out.

Does nobody have any ideas about this? It kind of makes WIN32OLE
unusable for automating certain long running tasks.

Hello,
Sorry for being too late to reply.

Charles L. wrote:

I sometimes have a problem whereby during a long operation using
WIN32OLE, I get a message box, which says:

“This action cannot be completed because the other program is busy.
Choose switch to activate the busy program and correct the problem.”

Could you show me the script which occurs the problem?
I’d like to investigate the problem.
And If I could, I’d like to change Win32OLE
to solve the problem.

Regards,
Masaki S.

Hello,

Charles L. wrote:

Well, it doesn’t look like much, it involves a proprietary com object
(factset api).

Code goes something like this:

comobj = WIN32OLE.new ‘FactSet.FactSet_API’
comobj.runapplication ‘Downloading’, ‘File=’ + file, ‘Batch=True’

How can I get the factset api?

If you look at what was added to the python equivalent (win32uiole),
they used the “AfxOleGetMessageFilter” function, and exposed some
methods on top of that, you can just do:

win32uiole.AfxOleInit()
win32uiole.SetMessagePendingDelay(aBigDelay);
win32uiole.EnableNotRespondingDialog(False);
win32uiole.EnableBusyDialog(False);

I had seen the python win32uiole, but the “AfxOleGetMessageFilter”
function is in MFC library.
And I won’t use MFC library because I don’t have MFC library
and Ruby source does not depend on MFC.
So I’d like to implement the python equivalent function
without MFC(AfxOleGetMessageFilter).
But I don’t know how to implement it now.
I need the sample script which occurs the problem in order
to investigate how to implement it without MFC.
And If I could implement it, I would need the sample script to check
my implementation is correct or not.

Regards,
Masaki S.

Masaki S. wrote:

Hello,
Sorry for being too late to reply.

Charles L. wrote:

I sometimes have a problem whereby during a long operation using
WIN32OLE, I get a message box, which says:

“This action cannot be completed because the other program is busy.
Choose switch to activate the busy program and correct the problem.”

Could you show me the script which occurs the problem?
I’d like to investigate the problem.
And If I could, I’d like to change Win32OLE
to solve the problem.

Regards,
Masaki S.

Well, it doesn’t look like much, it involves a proprietary com object
(factset api).

Code goes something like this:

comobj = WIN32OLE.new ‘FactSet.FactSet_API’
comobj.runapplication ‘Downloading’, ‘File=’ + file, ‘Batch=True’

Occasionally (it seems to be related to a timeout threshold), the
afore-mentioned message box will pop-up. If i click on “switch”, it will
open the start menu, and then it will proceed to completion without
problem.

If you look at what was added to the python equivalent (win32uiole),
they used the “AfxOleGetMessageFilter” function, and exposed some
methods on top of that, you can just do:

win32uiole.AfxOleInit()
win32uiole.SetMessagePendingDelay(aBigDelay);
win32uiole.EnableNotRespondingDialog(False);
win32uiole.EnableBusyDialog(False);

Thanks for your help,

Charles

Charles L. wrote:

Hmmm, I didn’t realize that the ruby source doesn’t use MFC. Is it
possible, do you think, to solve this problem by loading the
appropriate
dll and making the call using WIN32::Api? I tried to figure out an
approach this way with no success so far.

I am not sure… but…,
MFC is based on Windows API. So you could solve
it using WIN32::Api. But I think it is not easy way.

One possibility may be to write a simple, unfriendly test com object,
that is single threaded, and blocks for a long time when calling some
method. I think that should be sufficient to be able to reproduce the
problem locally?

Unfortunately, I have not been able to create test com object,
so I wrote that I need the factset api.
I think the factset api uses MFC and the com created with MFC
produce the problem easily.

Regards,
Masaki S.

Masaki S. wrote:

Hello,

Charles L. wrote:

Well, it doesn’t look like much, it involves a proprietary com object
(factset api).

Code goes something like this:

comobj = WIN32OLE.new ‘FactSet.FactSet_API’
comobj.runapplication ‘Downloading’, ‘File=’ + file, ‘Batch=True’

How can I get the factset api?

If you look at what was added to the python equivalent (win32uiole),
they used the “AfxOleGetMessageFilter” function, and exposed some
methods on top of that, you can just do:

win32uiole.AfxOleInit()
win32uiole.SetMessagePendingDelay(aBigDelay);
win32uiole.EnableNotRespondingDialog(False);
win32uiole.EnableBusyDialog(False);

I had seen the python win32uiole, but the “AfxOleGetMessageFilter”
function is in MFC library.
And I won’t use MFC library because I don’t have MFC library
and Ruby source does not depend on MFC.
So I’d like to implement the python equivalent function
without MFC(AfxOleGetMessageFilter).
But I don’t know how to implement it now.
I need the sample script which occurs the problem in order
to investigate how to implement it without MFC.
And If I could implement it, I would need the sample script to check
my implementation is correct or not.

Regards,
Masaki S.

Unfortunately you wouldn’t be able to get access to the factset api. Its
a proprietary, licensed data access api.

Hmmm, I didn’t realize that the ruby source doesn’t use MFC. Is it
possible, do you think, to solve this problem by loading the appropriate
dll and making the call using WIN32::Api? I tried to figure out an
approach this way with no success so far.

One possibility may be to write a simple, unfriendly test com object,
that is single threaded, and blocks for a long time when calling some
method. I think that should be sufficient to be able to reproduce the
problem locally?