Ken Dibble wrote on 2013-04-02: 
>  Thanks for the suggestions everybody.
>  
>  "What have you learned, Ken?"
>  
>  I probably should never have uttered the word "backup" because, although
it
>  was only one of the several processes I mentioned in my original message,
>  most people got focused on that instead of the core of the problem, which
is:
>  
>  ANY process that accesses a table on a network share that runs within ON
>  SHUTDOWN is vulnerable to that share being disconnected, even if the
>  process takes a very brief period of time.
>  
>  Essentially, I can test for the availability of resources before each
such
>  access, and/or "throw away" errors that occur during that period, so that
>  the shutdown proceeds in an orderly fashion. But I cannot guarantee that
>  everything will go the way I want.
>  
>  I don't think anybody seriously intended to tell me that I can't or
>  shouldn't try to save data or write to an audit table during ON SHUTDOWN.
>  But if you did, how can I accomplish those necessary and brief tasks when
>  the user shuts down the system?
>  
>  Thanks.
>  
>  Ken Dibble
>  www.stic-cil.org
> 

Ken,

I haven't had the bandwidth to test these options.

Check the _SCREEN.ReleaseType property. It may assist in knowing if a
shutdown is happening, though it may behave the same if the user clicked the
X in the upper right of the window.

VFP 9 is required to be able to capture the Windows event
"WM_QUERYENDSESSION", and the BindEvent of the _SCREEN object could cause
unexpected behaviors. When the Windows event happens, currently running code
stops to run the event handler. The use of SYS(2336) would help when you are
doing something that should not be broken. These times should be very
limited in time. I have used the SYS(2336) when I run a select ... to screen
noconsole and want to see the _TALLY results.

Either of these could give you a clue to do an abbreviated shutdown, or you
could popup a screen that is a Top-Level screen and use the BindEvent to
know the user shutdown the computer after they closed your application,
while you are running your long procedure.


Tracy Pearson
PowerChurch Software


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to