WIN32OLE disable busy dialog etc

Discussion in 'Ruby' started by Charles Lowe, Apr 17, 2008.

  1. Charles Lowe

    Charles Lowe Guest

    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.
    --
    Posted via http://www.ruby-forum.com/.
     
    Charles Lowe, Apr 17, 2008
    #1
    1. Advertising

  2. Charles Lowe

    Charles Lowe Guest

    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/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.
    --
    Posted via http://www.ruby-forum.com/.
     
    Charles Lowe, Apr 22, 2008
    #2
    1. Advertising

  3. 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
     
    Masaki Suketa, Apr 22, 2008
    #3
  4. Charles Lowe

    Charles Lowe Guest

    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-forum.com/.
     
    Charles Lowe, Apr 23, 2008
    #4
  5. 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
     
    Masaki Suketa, Apr 23, 2008
    #5
  6. Charles Lowe

    Charles Lowe Guest

    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-forum.com/.
     
    Charles Lowe, Apr 24, 2008
    #6
  7. 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
     
    Masaki Suketa, Apr 27, 2008
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Walzer

    Re: PIL (etc etc etc) on OS X

    Kevin Walzer, Aug 1, 2008, in forum: Python
    Replies:
    4
    Views:
    437
    Fredrik Lundh
    Aug 13, 2008
  2. Joe Van Dyk

    dialog that pops up when window busy

    Joe Van Dyk, Jan 11, 2006, in forum: Ruby
    Replies:
    2
    Views:
    131
    Joe Van Dyk
    Jan 11, 2006
  3. Masaki Suketa
    Replies:
    4
    Views:
    405
    Dave Burt
    Mar 27, 2006
  4. zxem
    Replies:
    1
    Views:
    256
  5. Replies:
    3
    Views:
    215
Loading...

Share This Page