Click here to Skip to main content
12,751,904 members (29,380 online)
Rate this:
Please Sign up or sign in to vote.
See more: VB VB.NET Terminal
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
myPDFDocument = System.Diagnostics.Process.Start(mypdf)  <--WORKS

user clicks ok that they want the PDF closed, the following command is called
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 11-Jan-13 9:52am
Updated 11-Jan-13 10:01am
Marcus Kramer 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)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170217.1 | Last Updated 11 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100