Click here to Skip to main content
15,894,460 members

CloseMainWindow doesn't work when application is called from terminal services

Member 1303755 asked:

Open original thread
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-
Tags: Visual Basic, Terminal

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



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