Solved

spawnl and NOWAIT

Posted on 1998-10-01
3
510 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

626 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