Solved

spawnl and NOWAIT

Posted on 1998-10-01
3
504 Views
Last Modified: 2012-05-04
I use spawnl(_P_NOWAIT, <path_to_mshearts>); and hearts
will launch while letting my program continue.
I use the same statement with a simple program I made
using Devel.Studio Vis.C++ and it is launched synchronously
instead.
The program I made is a project in MicroSoft's Vis.C++, created as a Win32 Application. It is a simple dialog box which just has a button to end the program.
Why is spawnl ignoring the NOWAIT? Asynchronous spawning should work with a Win32 application right?

Thanks for any tips..
RDR
0
Comment
Question by:rderidder
3 Comments
 

Author Comment

by:rderidder
ID: 1174161
to be exact, the function call which works for hearts is:


_spawnl(_P_NOWAIT,"C:\\Progra~1\\hearts\\mshearts.exe"," ", NULL);

0
 
LVL 8

Accepted Solution

by:
Answers2000 earned 100 total points
ID: 1174162
Why ? Limitation of the runtime library

Use

UINT ui = WinExec( "C:\\Progra~1\\hearts\\mshearts.exe", SW_SHOWNORMAL ) ;

if ( ui <= 31 )
{
 // some kind of error occurred
} else
{
  // spawned okay
}
0
 
LVL 22

Expert Comment

by:nietod
ID: 1174163
I don't see any reason why spawnl() shouldn't be working.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now