CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 1999
    Location
    Portugal
    Posts
    1

    Running MS-DOS compiler

    Hi!
    I'm developping a simple tool to make it easier to write, compile and configure Grammar Files and Systems Parameters for a Speech Recognition Application.
    After writing the Grammar - for which I developed a custom Notepad -, I need to compile it. The compiler runs on a DOS window, and prints all information to the screen. I need to get that information in order to display it on my tool.
    I call the compiler using the SHELL command, and it works OK. I tried to redirect the output to a file "gc xxx.xxx >filename", but it didn't work: no redirection was done. Then I tried putting the compile command on a batch file, and run the batch file from my app, but it didn't work.
    Needless to say, when doing this on the DOS prompt, it works fine.

    Anybody got any ideas?

    Thanks,

    Jorge


  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: Running MS-DOS compiler

    running the BAT (or CMD) file should work. You should wait though, till that process has finished before trying to read the file input from the redirected file.
    Use CreateProcess API and waitForSingleObject instead of the VB Shell command.


  3. #3
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: Running MS-DOS compiler

    Usually Compilers print their Error & other messages to StdErr. So, simple Redirection with > wont work. Try std error redirection command >& ( or is it &>, i forget).

    RK

  4. #4
    Join Date
    Sep 1999
    Posts
    17

    Re: Running MS-DOS compiler

    Under winnt sometimes it helps to load a new command - processor.
    So:
    - write a batch-file that calls your compiler.
    (xxx.xxx > filename)
    - call the batch file from your app like that:
    c:\winnt\system32\command.com /c x:\your_path\your_batch_file.bat


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured