Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

CreateProcess

Posted on 2002-04-08
2
Medium Priority
?
210 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 200 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
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 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.
Suggested Courses

730 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