RPC Server Unavailable 
Author Message
 RPC Server Unavailable

Hi there.  I was wondering if somebody could help me out -- I'm doing
some dispatching in win32com (with Mark H's extension, god bless the
man!) but I'm having some problems.  Is there a generic method I can
call to test if the application is still active?

For instance - I call a Word Dispatch.  I open a document, then make
it visible.  The user does whatever, then closes either the document
or the application - either way, it returns to the python app.  At
that point, how can I tell if the user minimized, closed, or what, the
application?  I'll be doing the same thign with Excel, and up until
now I've had good luck with a DispatchDict I experimented with, but
Word seems to complicate the matter, as does closing an Excel
document.

Anyway, the error I get is "RPC Server Unavailable."  And a summary of
my question - how can I tell if a dispatch, stuck in a variable, is
still active?

Thanks!

mjt
--
"Having said that, music is supposed to be
 in the world for celebration, ritual, and
 healing - that's the point for me."
                -- Trey Anastasio



Thu, 27 Nov 2003 11:58:29 GMT  
 RPC Server Unavailable

Quote:

> For instance - I call a Word Dispatch.  I open a document, then make
> it visible.  The user does whatever, then closes either the document
> or the application - either way, it returns to the python app.  At
> that point, how can I tell if the user minimized, closed, or what, the
> application?  I'll be doing the same thign with Excel, and up until
> now I've had good luck with a DispatchDict I experimented with, but
> Word seems to complicate the matter, as does closing an Excel
> document.

You could try hooking the Excel and Word events.  Check out the examples
in the win32com\test directory - Word and Excel are specifically tested
in testMSOfficeEvents.py.  You will probably want to consult the Office
docs or peruse the makepy generated file to see what events are available.

Quote:
> Anyway, the error I get is "RPC Server Unavailable."  And a summary of
> my question - how can I tell if a dispatch, stuck in a variable, is
> still active?

In the general case tho, you really have no alternative other than to
catch the exception.  Try doing something free from side-effects - such
as querying the current value of the "visible" property.

You probably should do this even if you can hook the events you are
after - Word or Excel could simply die with an Access Violation, and in
that case there is almost certainly no event that will tell you that...

Mark.



Thu, 27 Nov 2003 13:31:36 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. RPC Server not listening error

2. RPC Server Failure with ActiveX and Labview 5.1

3. How to set up an XML-RPC server (newbie)

4. xml-rpc server in python returning python lists...

5. XML-RPC Server

6. XML-RPC Server in Python

7. RPC clients and servers using Python

8. XML-RPC Server/Client Help Request

9. RPC hangs server sometimes ??!!

10. Python XML-RPC server as CGI

11. Ada83, RPC and IDL compiler/RPC generator

12. tcl-dp RPC vs SUN RPC

 

 
Powered by phpBB® Forum Software