Solved

CreateProcess

Posted on 2002-04-08
2
204 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

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…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
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.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

744 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

9 Experts available now in Live!

Get 1:1 Help Now