During a Logoff event, the system will broadcast to all windows asking them to close. Each application can then prompt the user regarding unsaved edits. After a period of time, Windows will get involved and start prompting the user regarding processes that are not shutting down. Refer to:
http://msdn.microsoft.com/en-us/library ... nding.aspx
The viewer process, PDFXCview.exe, is responding too eagerly and shutting down Before its hosting process has shut down thereby causing a loss of data in the case of the PDF Document. This is bad where the PDF Document has legal information, etc. Ignoring the loss of data, the hosting application is simply left out to die because its heart and soul has been ripped out of it unexpectedly.
Below is the exception that is received by the hosting application when the viewer process dies too early. Notice my application is prompting the viewer if it has been modified – getting ready to prompt the user if necessary to save changes before exiting:
Code: Select all
PDFViewerControl.InternalDoVerb :: Error found in call - Viewer.DoVerb("Documents[#4095].Modified", "get", "", out dataOut, 0);
Exception: System.Runtime.InteropServices.COMException (0x800706BA): The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
at PDFXCviewAxLib.IPDFXCview2.DoVerb(String ObjectName, String OperationName, Object DataIn, Object& DataOut, Int32 Flags)
at AxPDFXCviewAxLib.AxCoPDFXCview.DoVerb(String objectName, String operationName, Object dataIn, Object& dataOut, Int32 flags)
at <my call stack here>
As an example of proper behavior, load Notepad, type in the following:
“I love Apple and the fact that the OS is based on BSD Unix. I love Unix. Speaking of Presidents, think before you vote because we have to live with our decisions.”
Now logoff the system. You will notice that Notepad asks you to save the most insightful document ever written. This is the key point here, applications should be given the chance to save off unsaved changes. My application never gets that chance on Windows 7 or Server 2008.
And just because, you can find two nice videos (taken from an iPhone 4 (of course)) attached showing examples of closing down properly and being blown out of the water. The videos are very fast moving so you will want to pause often.
As always, scream if you need more.