There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
Nested Executables run from ASP.NET. The inner one hangs!!!


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
wango's Avatar
Member with 74 posts.
 
Join Date: Nov 2001
Location: Silver 'Spring
03-Feb-2004, 11:52 AM #1
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
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 05:53 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.