473,569 Members | 2,436 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

system() call in win32 c++ app

When using the function system() in a win32 c++ application, i notice a
seperate shell window opens and closes quickly when the app is run and this
system() call is encountered. Is there a way to suppress or prevent this
seperate shell window from opening or being seen ?

ex:
int result = system("some_ot her_app.exe arg1 arg2");
Feb 1 '07 #1
1 9517
In article <6F************ *************** *******@microso ft.com>,
=?Utf-8?B?RXJpY1A=?= <Er***@discussi ons.microsoft.c omwrote:
>When using the function system() in a win32 c++ application, i notice a
seperate shell window opens and closes quickly when the app is run and this
system() call is encountered. Is there a way to suppress or prevent this
seperate shell window from opening or being seen ?
Look up _spawnlp (and cousins) in MSDN, such as
http://msdn2.microsoft.com/en-gb/lib...fd(VS.80).aspx .
Basically, do something like

_spawnlp(_P_NOW AIT, "someprogra m", "arg1", "arg2", ... , NULL); // NULL required as last argument.

Nathan Mates
--
<*Nathan Mates - personal webpage http://www.visi.com/~nathan/
# Programmer at Pandemic Studios -- http://www.pandemicstudios.com/
# NOT speaking for Pandemic Studios. "Care not what the neighbors
# think. What are the facts, and to how many decimal places?" -R.A. Heinlein
Feb 1 '07 #2

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

Similar topics

9
4940
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my webserver runs that part of the script (see attached file, snippet.php), though, it doesn't go through. I don't get an error message or...
12
9596
by: hykim | last post by:
Hello, everyone. according to MSDN, there is any constructor of System.DirectoryServices.SearchResultCollection Class. if I implement DirectorySearcher.FindAll() method by myself, then how can I instanciate SearchResultCollection Class. more clearly, a SearchResult object is created, at the inside of FindAll() method, then how can I put...
0
1341
by: Dave McIver | last post by:
Hello all, Any help on this issue appreciated because I am getting a bit stuck! I am using VS.NET 2003. I have wrapped a multithreaded win32 dll using managed C++ and added a C# interface, but am having trouble directing the events generated by the win32 dll to events declared in the managed C++ layer, which are in turn directed to the...
3
3222
by: Sarah | last post by:
I have a function residing in a module that is doing some file copy and database query operations. This function is called from a regular form under a System.Windows.Forms.Timer control. The problem is that sometimes it gives an error - even when it is doing the same exact operations. It may fail on the 20th tick event or the 100th. The file...
1
6709
by: cwjacklin | last post by:
I read this article on http://msdn.microsoft.com/msdnmag/issues/03/07/NET/ which describes how to invoke C win32 dll from C# But I am running into a weird situation. I have an existing C win32 dll which I want to call from C#. When I use syntax like this
0
1965
by: Mike | last post by:
Hi, I have a collection object bound to a data grid, after I remove an item from the collection, the minute I click on the datagrid I get an error saying the specified argument was out of the range of valid values. After I remove the element from the collection I clear the databindings from the data grid and rebind it but as far as I can...
8
5742
by: =?Utf-8?B?YXVsZGg=?= | last post by:
i trying to collect windows services. i'm getting inconsistencies. the collection works every time locally. but remote collection yields different result depending on my lab environment. 1) in the same domain i start the collection on the remote machine i can get some 19 services without a problem then it will fail with: ...
62
4284
by: Laurent Deniau | last post by:
I just put the draft of my paper on the web: http://cern.ch/laurent.deniau/html/cos-oopsla07-draft.pdf I would be interested by any feedback from C programmers (with little OO knowledge) to improve the paper quality, even if I don't know yet if the paper will be accepted. It is not intended to be a manual nor an introduction to OOP. Just...
3
3016
by: sdDirtySox | last post by:
Hi all, I'm using system to invoke a script remotely on another machine. Something like this: system("/putty/plink.exe" 10.0.0.25 /home/foo); The problem is, sometimes the foo script freezes the remote machine's OS and system does not give control back to my program (which in turn causes my program to hang.) I didn't write the foo...
0
7703
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...
1
7679
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7983
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...
0
6287
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...
0
5223
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3657
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...
1
2117
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1228
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
946
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.