Solved

CreateProcess

Posted on 2002-04-08
2
206 Views
Last Modified: 2010-04-02
Hello,
I need a complete Listing to launch this lin with CreateProcess

if(strPgmName=="BUNNY COMBAT");
     WinExec("\"C:\\jnb\\jumpbump.exe\" \"-dat modify\\bunnycombat.zip\"", SW_SHOW);

THX

Edit: It works :) thank you...but if I try to stzart ist, i get an error: can't load rabbit.gob (a dat in the file \modify)  --- so how can I laod it too?

THX again
0
Comment
Question by:chrissss
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 50 total points
ID: 6926033
BOOL ExecuteCmd   (   LPSTR   pszCmd)
{
   STARTUPINFO         si;
   PROCESS_INFORMATION pi;

   BOOL                bRes;

   DWORD               dwCode  =   0;

   ZeroMemory  (   &si,    sizeof  (   STARTUPINFO));

   si.cb           =   sizeof  (   STARTUPINFO);
   si.dwFlags      =   STARTF_USESHOWWINDOW;
   si.wShowWindow  =   SW_SHOW;

   bRes    =   CreateProcess   (   NULL,
                                   pszCmd,
                                   NULL,
                                   NULL,
                                   TRUE,
                                   NORMAL_PRIORITY_CLASS,
                                   NULL,
                                   NULL,
                                   &si,
                                   &pi
                               );

   CloseHandle (   pi.hProcess);
   CloseHandle (   pi.hThread);

   return  (   bRes);
}

and call it like

ExecuteCmd ("\"C:\\jnb\\jumpbump.exe\" \"-dat modify\\bunnycombat.zip\"")
0
 

Author Comment

by:chrissss
ID: 6941756
Thx for this answer, but a little thing again: there is still an error: error loading rabbit.gob (its in the sub dir \modify)

my e-mail akshel@gmx.de


Greets
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
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 be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

770 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