Click to See Complete Forum and Search --> : Running MS-DOS compiler


Jorge Patrão
November 10th, 1999, 06:13 AM
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

Lothar Haensler
November 10th, 1999, 06:16 AM
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.

Ravi Kiran
November 11th, 1999, 04:13 AM
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

Ernsti
November 11th, 1999, 06:52 AM
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