WIN32OLE disable busy dialog etc

C

Charles Lowe

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.
 
C

Charles Lowe

Charles said:
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.
 
M

Masaki Suketa

Hello,
Sorry for being too late to reply.

Charles said:
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 Suketa
 
C

Charles Lowe

Masaki said:
Hello,
Sorry for being too late to reply.



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 Suketa

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
 
M

Masaki Suketa

Hello,

Charles said:
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 Suketa
 
C

Charles Lowe

Masaki said:
Hello,



How can I get the factset api?


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 Suketa

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?
 
M

Masaki Suketa

Charles said:
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 Suketa
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top