Hi Adam,

Well, now I think I'm confused too! :)

I do not believe the OLE interface is asynchronous, as I do wait for 
results from it before moving on.  Therefore, yes I am waiting until it 
is done.  However, if the program on the other end of the OLE connection 
hangs, I'd like to move on by killing the interface and starting a new 
one.

The code you suggested seems like a good way to go, however I don't know 
what I would test to see if it's still responding.  I'll look into that.

--
Thanks!
Bryan

Adam Shelly wrote:
> I'm probably very confused, but isn't the the OLE interface
> asynchronous already?
> Aren't you already waiting until it is done?
> 
> The following example runs excel until I close it from the menu, or 30
> seconds, whichever comes first.  I'd think you could apply the same
> thing to your app, especially if your simulation closes itself.
> 
> -Adam
> -------------------------------------------------------------------------------------
> excel = WIN32OLE.new("excel.application")
> excel['Visible'] = TRUE;
> t = Time.now
> while ((Time.now - t) < IT_SHOULD_NEVER_RUN_THIS_LONG)
>   break if !excel.Visible  #using Visible to check if it is running
>                                   #there is probably a better test.
>   sleep(1)
> end
> excel.Quit();

-- 
Posted via http://www.ruby-forum.com/.