Nested Executables run from ASP.NET. The inner one hangs!!! This is what is supposed to happen:. I am running a web-based ASP.NET app. It shell executes another (VB 6.0 based) executable "C:\MyFolder\Visio_Opener_Executable.exe". This executable in turn opens a Visio 2000 map. After the map opens, it is processed with info from the database and a gif file ("NGB_Basemap_Timestamp_AllGrey1_raster.gif") to be used in the code is made out of it. After the gif file is made a map is closed.
But that is not the way thinhgs happen. There is a "visio.exe" that I do not see (as it is supposed to be) but shows up in the "Windows Task Manager" process list and and does not go away - it hangs. If I ran the app 10 times, I will end up with 10 incidents of "visio.exe"
The gif is not even formed.
When I run the executable "C:\MyFolder\Visio_Opener_Executable.exe" by double clicking on it, a visio windows opens up, a gif file is mede and "visio.exe" does not show up in the task manager.
How do I get around my problems.
Would it help if "C:\MyFolder\Visio_Opener_Executable.exe" code is from VB.NET instead of VB 6.0?
<code>
<%@ Page Language="VB" %>
<%@ Import Namespace="System.Diagnostics" %>
<%@ Import Namespace="System.IO" %>
<html>
<body>
<form action="ChartTest.aspx" action="POST">
Value 1: <input type="text" name="v1" value="<%= Request("v1") %>"><br>
Value 2: <input type="text" name="v2" value="<%= Request("v2") %>"><br>
Value 3: <input type="text" name="v3" value="<%= Request("v3") %>"><br><br>
<input type="submit" value="Redraw Bar Chart"><br><br>
</form>
<script language="VB" runat="server">
Dim sngValue1 As Single, sngValue2 As Single, sngValue3 As Single
Sub Page_Load()
'Set a time-out value.
Dim timeOut As Integer = 10000
'Get the path to the system folder.
Dim sysFolder As String = _
Environment.GetFolderPath(Environment.SpecialFolder.System)
'Create a new ProcessStartInfo structure.
Dim pInfo As New ProcessStartInfo()
'Set the file name member of pinfo to the executable.
'pInfo.FileName = "notepad.exe"
pInfo.FileName = "C:\MyFolder\Visio_Opener_Executable.exe"
'Start the process.
Dim p As Process = Process.Start(pInfo)
'Wait for the process window to complete loading.
p.WaitForInputIdle()
'Wait for the process to exit.
p.WaitForExit(timeOut)
'HasExited is true if the application closed before the time-out.
If p.HasExited = False Then
'Process is still running.
'Test to see if process is hung up.
If p.Responding Then
'Process was responding; close the main window.
p.CloseMainWindow()
' mmk 2.2.2004 added
p.Kill()
Else
'Process was not responding; force the process to close.
p.Kill()
End If
End If
End Sub
</script>
<img src="C:\Inetpub\Wwwroot\visiomap\NGB_Basemap_Timestamp_AllGrey1_raster.gif" >
</body>
</html>
'
"C:\MyFolder\Visio_Opener_Executable.exe" is made out of VB 6.0 (not VB.NET) and the
function is as below:
......................................................
......................................................
Private Function ProcessMapShapes()
'Instance of master on page
Dim appVisio As Visio.Application
On Error GoTo TrapIt
Set appVisio = CreateObject("visio.application")
Set docObj = appVisio.Documents.Open(destFile)
Print #logFileInt, separatorStr
Print #logFileInt, "DONE lauching a VISIO App"
' Create a document based on the Basic Diagram template which
' automatically opens the Basic Shapes stencil.
' Set docObj = docsObj.Add("Geographic Maps.vst")
Set pagsObj = appVisio.ActiveDocument.Pages
.......... code deleted.........
appVisio.Quit
Exit_This:
Exit Function
TrapIt:
Resume Exit_This
End Function
.................
..................
..................
</code>
__________________ Wango |