[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

WIN32OLE disable busy dialog etc

Charles L.

4/17/2008 7:34:00 AM

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/0...,
and the commit
http://pywin32.cvs.sourceforge.net/pywin32/pywin32/Pythonwin/win32uiole.cpp?r1=1.5&....

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.
--
Posted via http://www.ruby-....

6 Answers

Charles L.

4/21/2008 11:42:00 PM

0

Charles Lowe 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/0...,
> and the commit
> http://pywin32.cvs.sourceforge.net/pywin32/pywin32/Pythonwin/win32uiole.cpp?r1=1.5&....
>
> 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.
--
Posted via http://www.ruby-....

Masaki Suketa

4/22/2008 1:05:00 PM

0

Hello,
Sorry for being too late to reply.

Charles Lowe 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 Suketa


Charles L.

4/23/2008 12:58:00 AM

0

Masaki Suketa wrote:
> Hello,
> Sorry for being too late to reply.
>
> Charles Lowe 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 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
--
Posted via http://www.ruby-....

Masaki Suketa

4/23/2008 11:36:00 AM

0

Hello,

Charles Lowe 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 Suketa


Charles L.

4/24/2008 9:26:00 AM

0

Masaki Suketa wrote:
> Hello,
>
> Charles Lowe 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 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?
--
Posted via http://www.ruby-....

Masaki Suketa

4/26/2008 11:11:00 PM

0

Charles Lowe 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 Suketa