473,809 Members | 2,735 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Process.Start() is blocking

jrm
..Net v1.1

I am trying to launch a MS Word merge document. It is linked to an Access mdb that has a parameterized query that pops up an input dialog when you open it. None of this should matter of course, but I think maybe it is causing the problem..?

I am doing this:
System.Diagnost ics.Process merge_doc = new System.Diagnost ics.Process();
merge_doc.Start Info.FileName = "c:\adoc.do c";
merge_doc.Start ();

The start call is blocking until I close the popup input form... ?! Even stranger is that a message loop is still running somewhere because my main application continues to run. The menu handler in which I start the process does in fact block though. Eventually control returns once I close that Access popup, like I said. I thought Start() was not supposed to block? Workarounds?

thx

---
Posted via DotNetSlackers. com
Jan 24 '07 #1
2 4716
On Tue, 23 Jan 2007 15:57:16 -0800, jrm wrote:
>.Net v1.1

I am trying to launch a MS Word merge document. It is linked
to an Access mdb that has a parameterized query that pops up
an input dialog when you open it. None of this should matter of
course, but I think maybe it is causing the problem..?

I am doing this:
System.Diagnos tics.Process merge_doc = new System.Diagnost ics.Process();
merge_doc.Star tInfo.FileName = "c:\adoc.do c";
merge_doc.Star t();
You have "\a" in your filename string, which is the ASCII BEL
character - it sounds a beep. You need to use one of the standard
alternatives:

@"c:\adoc.do c"
"c:/adoc.doc" - Windows understands unix-style paths
"c:\\adoc.d oc"

I suspect that it is blocking because it is looking for a file called:
"c:%doc.doc ", where % is the BEL character. It is not finding the
file and hanging. You should also look at how you are checking for
errors if not finding the target file causes a hang; maybe check that
the file exists before trying to open it.

rossum

>The start call is blocking until I close the popup input form... ?!
Even stranger is that a message loop is still running somewhere
because my main application continues to run. The menu handler in
which I start the process does in fact block though. Eventually
control returns once I close that Access popup, like I said. I thought
Start() was not supposed to block? Workarounds?

thx

---
Posted via DotNetSlackers. com
Jan 24 '07 #2
jrm
No, im sorry. That was a typo. I didnt copy the code verbatim... Yes do I have double slashes \\ in the pathname string.

I just tried to pinvoke ShellExecute() and it has the exact same behavior. Not only does it block, but it runs a message loop while doing so. Totally weirdo.

I found a workaround though. I can put the 'start adoc.doc' command in a .bat file, or pinvoke CreateProcess something like CreateProcess(. ."WINWORD.EX E", "open adoc.doc"...). These do not block.
---
Posted via DotNetSlackers. com
Jan 24 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4068
by: D. Buck | last post by:
Details: MS SQL 2000 dual Intel 1.2 GHz processors. 1 GB RAM 2.1 GB dB Dynamic Memory Managment. No other apps running on this server. First question: Since I have Dynamic Memory Managment setup, Is it usuall that the sqlsrv.exe process on the server steadily climbs and is in the 800 to
0
288
by: Stephen.Haeney | last post by:
I am deveeloping a WinForm application where I need to display a HTML page to the user. I would like to use IE to display this page then wait until they have closed the IE window before continuing with the application. Essentially, I want to make a blocking call to IE. However, when I use the code below, I get vvariable results depending on whether or not the process is running within the IDE or stand alone. ProcessStartInfo...
3
12880
by: Michael | last post by:
Dear All I have problem with my database server which running SQL server 2000. The server running very slow. The worst case, to save a record required more than 20-30 seconds. Since this problem, I usually monitoring Process Info from Enterprise Manager (Management - Current Activity), and I found a misterious process as follow : 1. User : System
4
6598
by: Prince Kumar | last post by:
I joined a company recently and they have a java program which hangs (does nothing) after a while. This is no way consistent. It could succeed quite a few times and can fail a few other times. There is no consistency when it fails. Could anyone here shed some light on how to debug/resolve the issue. I guess IBM looked at the issue and were not able to pinpoint where the issue is. When the program hangs and when force the DB2...
0
2256
by: henning.friese | last post by:
Hello NG, I'm need to write some code which creates tiff files from various document types (doc, pdf, xls). I want to do this by ShellExecuting (via System.Diagnostics.Process) the doc-files with the "print"-verb. This works for me. However, I need to handle the case when a printing application doesnt't quit in a given timespan (for example a password-protected word-document). So I've tried the following:
7
7364
by: Bob | last post by:
Process.start("Mydoc.doc") starts Word with the file. I need to wait for Word to be closed before more code can execute in my app. How can I do this? Thanks for any help Bob
11
5068
by: garyusenet | last post by:
For this first time today I used the System.Diagnositcs namespace to launch a program from my c# code. The program launches OK but I have something which has completely stumped me. The SetWindowPos method does not work. If I run the code as it is presented below, app.exe launches in its own window and is displayed at the top left part of the screen. However it isn't repositioned which is what the last piece of code should do. HOWEVER if...
31
4082
by: Nikos Chantziaras | last post by:
Hello. Is there a way to check if the current process has an stdin handle? In the win32 API, one can do: _eof(_fileno(stdin)) Crucial here is that the above doesn't block. Is there a standard way to do the same without resorting to OS-specific API calls?
12
2490
by: =?Utf-8?B?ZXAu?= | last post by:
What is preferred method to start an app process and then fill in form fields? The following prog does not compile (b/c AppActivate does not have the correct param): ---------------------------------------------------------------------------------------- Imports Microsoft.VisualBasic Imports System.Windows.Forms Imports System.Diagnostics Module Module1 Sub Main()
0
9721
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9602
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10639
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10120
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7661
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5688
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.