Discussion
Topics
Last Day
Last Week
Tree View

Search
New Messages
Keyword Search

Help
Getting Started
Formatting
Troubleshooting
Program Credits

Utilities
Edit Profile
Administration
Contact

 
forum - discussion board
- about - downloads - registration - forum - misc - home - © 1996-99 GWD Text Editor

Problem redirecting NMAKE to output window

GWD Text Editor Forum: Technical Support: Problem redirecting NMAKE to output window
Top of pagePrevious messageNext messageBottom of pageLink to this message  By Corey Stinson on Tuesday, April 25, 2000 - 06:37 pm:

I'm doing some embedded assembler work and using Visual C++ 6.0's NMAKE.EXE to "build" the project. I want to be able to call NMAKE as a tool and have the output redirected to a new window. NMAKE calls the A51.EXE 8xC51 assembler (an old typical 16-bit DOS program.)

When I try to do this I get about four errors as follows:

16-bit MS-DOS Subsystem - NTVDM has encoutered a System Error - Access is denied, with the choices to Terminate or Ignore. If I choose Ignore about four times my window opens and all of the output that I expect to see is there. Apparently a harmless but annoying and anti-productive error message. Can I circumvent this in any way? .. and why is it happening?

Corey Stinson


Top of pagePrevious messageNext messageBottom of pageLink to this message  By Vedran Gaco (Vgaco) on Wednesday, April 26, 2000 - 12:38 am:

I guess that 16-bit program may have problems with NTFS file permision??? Source code of GTECAP32.EXE (program which GWD Text Editor use to redirect stdin and stderr to a temporary file) is very simple:

/******************************************************
  Syntax: GTECAP32.EXE CaptureFile Program [Options..]
          will execute
       Program [Options...] > File
*******************************************************/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <process.h>

int main(int argc, char *argv[], char *env[])
{
   FILE   *fpStdout, *fpStderr;
   int    i;
   char   *new_argv[256];

   if (argc < 3)
      return 1;

   fpStdout = freopen(argv[1], "w", stdout);
   fpStderr = freopen(argv[1], "w", stderr);

   new_argv[0] = argv[0];
   for (i = 3; i < argc; ++i)
   {
      new_argv[i-2] = argv[i];
   }
   new_argv[i-2] = NULL;
   spawnvp(P_WAIT, argv[2], new_argv);

   fclose(fpStdout);
   fclose(fpStderr);

   return 0;
}


Add a Message


This is a public posting area. If you do not have an account, enter your full name into the "Username" box and leave the "Password" box empty. Your e-mail address is optional.
Username:  
Password:
E-mail:


- about - downloads - registration - forum - misc - home - © 1996-99 GWD Text Editor