Solved

CreateProcess

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
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…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
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.

943 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

17 Experts available now in Live!

Get 1:1 Help Now