Click here to Skip to main content
15,885,365 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
We are re-writing a VB.NET application that uses the System.Diagnositcs.Process.Start(mypdf)call to open a PDF document. A message box is displayed and when the user clicks OK, the PDf is typically closed using the CloseMainWindow() call. (we also check for the HasExited status)

command to create and display the PDF
VB
myPDFDocument = System.Diagnostics.Process.Start(mypdf)  <--WORKS


user clicks ok that they want the PDF closed, the following command is called
VB
MyPDFDocument.CloseMainWindow() <--Nothing happens
MyPDFDocument.Close()<--Nothing happens
 ---- then we do some other flag setting and go on our merry way


This code works fine in debug and when installed locally. The issue comes up when we deploy the code to a vWorkspace installation. The Msgbox windows and options are presented but the open PDF does not close.

I am not able to debug in a hosted environment so I am flying blind. From what I have read to date, it does not look like this function is supported. I did look into the Terminal services commands but those appear to be to terminate the session which I do not want to do.

Before I re-engineer everything, I am wondering if anyone has had the same issue and I am missing the obvious.


thank you-
Posted
Updated 11-Jan-13 9:01am
v2
Comments
fjdiewornncalwe 11-Jan-13 15:53pm    
I don't want to insinuate that you haven't thought of this, but why can't the user just close the pdf viewer from the pdf viewer window itself? Or am I missing something fundamental here to your process?
Zoltán Zörgő 11-Jan-13 17:16pm    
Added by OP as answer:

Thanks for your reply. That would be my preference as well. We have business and training requirements that dictate we ensure the document is closed prior to continuing through the rest of the process. There are some valid reasons for this, but also a bit of "this is how it was always done" thrown into the mix. If I propose a change in process, I need to be sure there isn't a simple technical solution which I am over-looking. Since posting, I am started looking at saving the file name and then check to see if it is open if they try to proceed. I was just hoping I was missing a parameter or something that would make the existing logic work in vWorkspace.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900