Advanced? Not Advanced? Anyone?

This is a discussion on Advanced? Not Advanced? Anyone? within the C++ Programming forums, part of the General Programming Boards category; Okay here is what I want to achieve, I want to be able to write in DOS from my program ...

  1. #1
    Registered User
    Join Date
    Apr 2004
    Posts
    19

    Unhappy Advanced? Not Advanced? Anyone?

    Okay here is what I want to achieve, I want to be able to write in DOS from my program that I am creating. I've execed it with:

    Code:
    Code:
    .... 
    char szPath[] = "C:\\WINDOWS\\system32\\cmd.exe"; 
    .... 
                 {    
            HINSTANCE hRet = ShellExecute( 
            HWND_DESKTOP, //Parent window 
            "open",       //Operation to perform 
            szPath,       //Path to program 
            NULL,         //Parameters 
            NULL,         //Default directory 
            SW_SHOW);     //How to open 
       } 
    ....
    Now I want my program to enter commands in DOS or text or anything. Is this very complicated? Moderatly Complicated? Could someone help me?

    By the way this is a crosspost from cpp-home.com because I just want to let both sets of regulars have a crack and my problem.
    jotun

    n : (Norse mythology) one of a race of giants often in conflict with the Aesir [syn: Jotun, Jotunn]

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,786
    You'd be better off with CreateProcess and the plethora of options it offers to make this easier (giving you handles to the streams etc..)

    Try this...I found it usefull when I wanted to control a console - http://www.codeproject.com/dialog/quickwin.asp

  3. #3
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    Are you referring to inter-process communication?

    Check out MSDN.

    http://support.microsoft.com/default...NoWebContent=1

    Kuphryn

  4. #4
    Caffienated jinx's Avatar
    Join Date
    Oct 2001
    Posts
    235
    If I were you, I would consider just passing commands direct to the DOS progs and forget going through command/cmd. DOS is a shell (used to be pure until WinME?) and is an operating system. The DOS u use today is an emulator of the original. It called programs to run in memory upon user-based input or batches. Theres another idea...write a batch file and call it from your proggy...
    ------------------

    **scratch that, I thought you were only interested in passing to DOS. Do a CreateProc and get it over. Difficulty Rating: Low/Moderate
    Last edited by jinx; 04-28-2004 at 08:05 PM.
    Weeel, itss aboot tieme wee goo back too Canada, eeehy boyss.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. What's advanced c++ contents ?
    By toysoldier in forum C++ Programming
    Replies: 8
    Last Post: 09-27-2004, 08:12 PM
  2. printf advanced!!
    By gooddevil in forum C Programming
    Replies: 9
    Last Post: 05-25-2004, 07:45 AM
  3. Advanced but yet general
    By Rhodium in forum C Programming
    Replies: 6
    Last Post: 08-09-2003, 12:46 PM
  4. Advanced Linux Programming
    By drdroid in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 07-24-2003, 02:01 PM
  5. you advanced people, read this
    By Leeman_s in forum C++ Programming
    Replies: 2
    Last Post: 10-04-2001, 08:26 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21