Solved

spawnl and NOWAIT

Posted on 1998-10-01
3
503 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

746 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

13 Experts available now in Live!

Get 1:1 Help Now