Solved

CreateProcess

Posted on 2002-04-08
2
209 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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.

623 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