如何获取一个控制台程序的输出信息?

rsdtt 2014-02-25 11:17:49
我需要根据一个控制台程序输出的信息来确定我下一步操作
比如我运行system("a.exe");
我要等到a.exe输出success我才有下一步的操作

万分感谢
...全文
1694 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
lijie12233 2016-09-16
  • 打赏
  • 举报
回复
楼主你问题解决了吗,小弟碰到相同的问题了
rsdtt 2014-02-27
  • 打赏
  • 举报
回复
引用 11 楼 zhao4zhong1 的回复:
_pipe Creates a pipe for reading and writing. Process and Environment Control Routines See Also _open
晚些看看,现在在忙
W1nds 2014-02-26
  • 打赏
  • 举报
回复
百度下双管道通信的东西 或者让cmd执行命令的时候>>重定向到文件然后从文件里面读取返回信息
Cherishe7 2014-02-26
  • 打赏
  • 举报
回复
#pragma comment( linker, "/subsystem:windows /entry:WinMainCRTStartup" ) 调出控制台
赵4老师 2014-02-26
  • 打赏
  • 举报
回复
_pipe Creates a pipe for reading and writing. int _pipe( int *phandles, unsigned int psize, int textmode ); Routine Required Header Optional Headers Compatibility _pipe <io.h> <fcntl.h>,1 <errno.h>2 Win 95, Win NT 1 For _O_BINARY and _O_TEXT definitions. 2 errno definitions. For additional compatibility information, see Compatibility in the Introduction. Libraries LIBC.LIB Single thread static library, retail version LIBCMT.LIB Multithread static library, retail version MSVCRT.LIB Import library for MSVCRT.DLL, retail version Return Value _pipe returns 0 if successful. It returns –1 to indicate an error, in which case errno is set to one of two values: EMFILE, which indicates no more file handles available, or ENFILE, which indicates a system file table overflow. Parameters phandles[2] Array to hold read and write handles psize Amount of memory to reserve textmode File mode Remarks The _pipe function creates a pipe. A pipe is an artificial I/O channel that a program uses to pass information to other programs. A pipe is similar to a file in that it has a file pointer, a file descriptor, or both, and can be read from or written to using the standard library’s input and output functions. However, a pipe does not represent a specific file or device. Instead, it represents temporary storage in memory that is independent of the program’s own memory and is controlled entirely by the operating system. _pipe is similar to _open but opens the pipe for reading and writing, returning two file handles instead of one. The program can use both sides of the pipe or close the one it does not need. For example, the command processor in Windows NT creates a pipe when executing a command such as PROGRAM1 | PROGRAM2 The standard output handle of PROGRAM1 is attached to the pipe’s write handle. The standard input handle of PROGRAM2 is attached to the pipe’s read handle. This eliminates the need for creating temporary files to pass information to other programs. The _pipe function returns two handles to the pipe in the phandles argument. The element phandles[0] contains the read handle, and the element phandles[1] contains the write handle. Pipe file handles are used in the same way as other file handles. (The low-level input and output functions _read and _write can read from and write to a pipe.) To detect the end-of-pipe condition, check for a _read request that returns 0 as the number of bytes read. The psize argument specifies the amount of memory, in bytes, to reserve for the pipe. The textmode argument specifies the translation mode for the pipe. The manifest constant _O_TEXT specifies a text translation, and the constant _O_BINARY specifies binary translation. (See fopen for a description of text and binary modes.) If the textmode argument is 0, _pipe uses the default translation mode specified by the default-mode variable _fmode. In multithreaded programs, no locking is performed. The handles returned are newly opened and should not be referenced by any thread until after the _pipe call is complete. In order to use the _pipe function to communicate between a parent and a child process, each process must have only one handle open on the pipe. The handles must be opposites: if the parent has a read handle open, then the child must have a write handle open. The easiest way to do this is to OR (|) the _O_NOINHERIT flag with textmode. Then, use _dup or _dup2 to create an inheritable copy of the pipe handle you wish to pass to the child. Close the original handle, and spawn the child process. Upon returning from the spawn call, close the 'duplicate' handle in the parent process. See Example 2 below for more information. In Windows NT and Windows 95, a pipe is destroyed when all of its handles have been closed. (If all read handles on the pipe have been closed, writing to the pipe causes an error.) All read and write operations on the pipe wait until there is enough data or enough buffer space to complete the I/O request. Example 1
/* PIPE.C: This program uses the _pipe function to pass streams of
 * text to spawned processes.
 */

#include <stdlib.h>
#include <stdio.h>
#include <io.h>
#include <fcntl.h>
#include <process.h>
#include <math.h>

enum PIPES { READ, WRITE }; /* Constants 0 and 1 for READ and WRITE */
#define NUMPROBLEM 8

void main( int argc, char *argv[] )
{

   int hpipe[2];
   char hstr[20];
   int pid, problem, c;
   int termstat;

   /* If no arguments, this is the spawning process */
   if( argc == 1 )
   {

      setvbuf( stdout, NULL, _IONBF, 0 );

      /* Open a set of pipes */
      if( _pipe( hpipe, 256, O_BINARY ) == -1 )
          exit( 1 );


      /* Convert pipe read handle to string and pass as argument 
       * to spawned program. Program spawns itself (argv[0]).
       */
      itoa( hpipe[READ], hstr, 10 );
      if( ( pid = spawnl( P_NOWAIT, argv[0], argv[0], 
            hstr, NULL ) ) == -1 )
          printf( "Spawn failed" );

      /* Put problem in write pipe. Since spawned program is 
       * running simultaneously, first solutions may be done 
       * before last problem is given.
       */
      for( problem = 1000; problem <= NUMPROBLEM * 1000; problem += 1000)
      {

         printf( "Son, what is the square root of %d?\n", problem );
         write( hpipe[WRITE], (char *)&problem, sizeof( int ) );

      }

      /* Wait until spawned program is done processing. */
      _cwait( &termstat, pid, WAIT_CHILD );
      if( termstat & 0x0 )
         printf( "Child failed\n" );


      close( hpipe[READ] );
      close( hpipe[WRITE] );

   }

   /* If there is an argument, this must be the spawned process. */
   else
   {

      /* Convert passed string handle to integer handle. */
      hpipe[READ] = atoi( argv[1] );

      /* Read problem from pipe and calculate solution. */
      for( c = 0; c < NUMPROBLEM; c++ )
      {

        read( hpipe[READ], (char *)&problem, sizeof( int ) );
        printf( "Dad, the square root of %d is %3.2f.\n",
                 problem, sqrt( ( double )problem ) );

      }
   }
}
Output
Son, what is the square root of 1000?
Son, what is the square root of 2000?
Son, what is the square root of 3000?
Son, what is the square root of 4000?
Son, what is the square root of 5000?
Son, what is the square root of 6000?
Son, what is the square root of 7000?
Son, what is the square root of 8000?
Dad, the square root of 1000 is 31.62.
Dad, the square root of 2000 is 44.72.
Dad, the square root of 3000 is 54.77.
Dad, the square root of 4000 is 63.25.
Dad, the square root of 5000 is 70.71.
Dad, the square root of 6000 is 77.46.
Dad, the square root of 7000 is 83.67.
Dad, the square root of 8000 is 89.44.
Example 2
// This is a simple filter application.  It will spawn 
// the application on  command line. But before spawning 
// the application, it will create a pipe that will direct the 
// spawned application's stdout to the filter.  The filter 
// will remove ASCII 7 (beep) characters.

// Beeper.Cpp

/* Compile options needed: None */
#include <stdio.h>
#include <string.h>

int main()
{
   int   i;
   for(i=0;i<100;++i)
      {
         printf("\nThis is speaker beep number %d... \n\7", i+1);
      }
   return 0;
}


// BeepFilter.Cpp
/* Compile options needed: none
   Execute as: BeepFilter.exe <path>Beeper.exe
*/
#include <windows.h>
#include <process.h>
#include <memory.h>
#include <string.h>
#include <stdio.h>
#include <fcntl.h>
#include <io.h>

#define   OUT_BUFF_SIZE 512
#define   READ_HANDLE 0
#define   WRITE_HANDLE 1
#define   BEEP_CHAR 7

char szBuffer[OUT_BUFF_SIZE];

int Filter(char* szBuff, ULONG nSize, int nChar)
{
   char* szPos = szBuff + nSize -1;
   char* szEnd = szPos;
   int nRet = nSize;

   while (szPos > szBuff)
   {
      if (*szPos == nChar)
         {
            memmove(szPos, szPos+1, szEnd - szPos);
            --nRet;
         }
      --szPos;
   }
   return nRet;
}

int main(int argc, char** argv)
{
   int nExitCode = STILL_ACTIVE;
   if (argc >= 2)
   {
      HANDLE hProcess;
      int hStdOut;
      int hStdOutPipe[2];

      // Create the pipe
      if(_pipe(hStdOutPipe, 512, O_BINARY | O_NOINHERIT) == -1)
         return   1;

      // Duplicate stdout handle (next line will close original)
      hStdOut = _dup(_fileno(stdout));

      // Duplicate write end of pipe to stdout handle
      if(_dup2(hStdOutPipe[WRITE_HANDLE], _fileno(stdout)) != 0)
         return   2;

      // Close original write end of pipe
      close(hStdOutPipe[WRITE_HANDLE]);

      // Spawn process
      hProcess = (HANDLE)spawnvp(P_NOWAIT, argv[1], 
       (const char* const*)&argv[1]);

      // Duplicate copy of original stdout back into stdout
      if(_dup2(hStdOut, _fileno(stdout)) != 0)
         return   3;

      // Close duplicate copy of original stdout
      close(hStdOut);

      if(hProcess)
      {
         int nOutRead;
         while   (nExitCode == STILL_ACTIVE)
         {
            nOutRead = read(hStdOutPipe[READ_HANDLE], 
             szBuffer, OUT_BUFF_SIZE);
            if(nOutRead)
            {
               nOutRead = Filter(szBuffer, nOutRead, BEEP_CHAR);
               fwrite(szBuffer, 1, nOutRead, stdout);
            }

            if(!GetExitCodeProcess(hProcess,(unsigned long*)&nExitCode))
               return 4;
         }
      }
   }

   printf("\nPress \'ENTER\' key to continue... ");
   getchar();
   return nExitCode;
}

Process and Environment Control Routines See Also _open
rsdtt 2014-02-26
  • 打赏
  • 举报
回复
引用 5 楼 SXJIAKE 的回复:
楼主先简单点来,比如试试运行你这个程序后,输出 %ERRORLEVEL% 看看这个程序在 success 和失败时的返回值是否不同。如果不同的话,你可以在运行完毕后直接读取环境变量的值来确定它是否执行成功。如果这个程序是你自己写的话,你可以在成功时返回零,创建进程可以 GetExitCodeProcess 取得返回值判断其是否成功执行。
不是自己写的
rsdtt 2014-02-26
  • 打赏
  • 举报
回复
引用 4 楼 zhao4zhong1 的回复:
剽窃三楼:
#pragma comment(lib,"user32")
#include <stdio.h>
#include <windows.h>
int main() {
    SECURITY_ATTRIBUTES sa          = {0};
    STARTUPINFO         si          = {0};
    PROCESS_INFORMATION pi          = {0};
    HANDLE              hPipeOutputRead  = NULL;
    HANDLE              hPipeOutputWrite = NULL;
    HANDLE              hPipeInputRead   = NULL;
    HANDLE              hPipeInputWrite  = NULL;
    BOOL                bTest = 0;
    DWORD               dwNumberOfBytesRead = 0;
    DWORD               dwNumberOfBytesWrite = 0;
    CHAR                szMsg[100];
    CHAR                szBuffer[256];

    sa.nLength = sizeof(sa);
    sa.bInheritHandle = TRUE;
    sa.lpSecurityDescriptor = NULL;

    // Create pipe for standard output redirection.
    CreatePipe(&hPipeOutputRead,  // read handle
            &hPipeOutputWrite, // write handle
            &sa,      // security attributes
            0      // number of bytes reserved for pipe - 0 default
            );

    // Create pipe for standard input redirection.
    CreatePipe(&hPipeInputRead,  // read handle
            &hPipeInputWrite, // write handle
            &sa,      // security attributes
            0      // number of bytes reserved for pipe - 0 default
            );

    // Make child process use hPipeOutputWrite as standard out,
    // and make sure it does not show on screen.
    si.cb = sizeof(si);
    si.dwFlags     = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES;
    si.wShowWindow = SW_HIDE;
    si.hStdInput   = hPipeInputRead;
    si.hStdOutput  = hPipeOutputWrite;
    si.hStdError   = hPipeOutputWrite;

    CreateProcess (
          NULL, "cmd.exe",
          NULL, NULL,
          TRUE, 0,
          NULL, NULL,
          &si, &pi);

    // Now that handles have been inherited, close it to be safe.
    // You don't want to read or write to them accidentally.
    CloseHandle(hPipeOutputWrite);
    CloseHandle(hPipeInputRead);

    // Now test to capture DOS application output by reading
    // hPipeOutputRead.  Could also write to DOS application
    // standard input by writing to hPipeInputWrite.
    sprintf(szMsg, "dir *.txt /b\nexit\n");
    WriteFile(
          hPipeInputWrite,      // handle of the write end of our pipe
          &szMsg,               // address of buffer that send data
          18,                   // number of bytes to write
          &dwNumberOfBytesWrite,// address of number of bytes read
          NULL                  // non-overlapped.
          );

    while(TRUE)
    {
       bTest=ReadFile(
          hPipeOutputRead,      // handle of the read end of our pipe
          &szBuffer,            // address of buffer that receives data
          256,                  // number of bytes to read
          &dwNumberOfBytesRead, // address of number of bytes read
          NULL                  // non-overlapped.
          );

      if (!bTest){
          sprintf(szMsg, "Error #%d reading pipe.",GetLastError());
          MessageBox(NULL, szMsg, "WinPipe", MB_OK);
          break;
      }

      // do something with data.
      szBuffer[dwNumberOfBytesRead] = 0;  // null terminate
      MessageBox(NULL, szBuffer, "WinPipe", MB_OK);
    }

    // Wait for CONSPAWN to finish.
    WaitForSingleObject (pi.hProcess, INFINITE);

    // Close all remaining handles
    CloseHandle (pi.hProcess);
    CloseHandle (hPipeOutputRead);
    CloseHandle (hPipeInputWrite);

    return 0;
}
用不了。。
rsdtt 2014-02-26
  • 打赏
  • 举报
回复
引用 3 楼 zgl7903 的回复:
VC6 MSDN上有例子

      SECURITY_ATTRIBUTES sa          = {0};
      STARTUPINFO         si          = {0};
      PROCESS_INFORMATION pi          = {0};
      HANDLE              hPipeOutputRead  = NULL;
      HANDLE              hPipeOutputWrite = NULL;
      HANDLE              hPipeInputRead   = NULL;
      HANDLE              hPipeInputWrite  = NULL;
      BOOL                bTest = 0;
      DWORD               dwNumberOfBytesRead = 0;
      CHAR                szMsg[100];
      CHAR                szBuffer[256];

      sa.nLength = sizeof(sa);
      sa.bInheritHandle = TRUE;
      sa.lpSecurityDescriptor = NULL;


      // Create pipe for standard output redirection.
      CreatePipe(&hPipeOutputRead,  // read handle
              &hPipeOutputWrite, // write handle
              &sa,      // security attributes
              0      // number of bytes reserved for pipe - 0 default
              );

      // Create pipe for standard input redirection.
      CreatePipe(&hPipeInputRead,  // read handle
              &hPipeInputWrite, // write handle
              &sa,      // security attributes
              0      // number of bytes reserved for pipe - 0 default
              );

      // Make child process use hPipeOutputWrite as standard out,
      // and make sure it does not show on screen.
      si.cb = sizeof(si);
      si.dwFlags     = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES;
      si.wShowWindow = SW_HIDE;
      si.hStdInput   = hPipeInputRead;
      si.hStdOutput  = hPipeOutputWrite;
      si.hStdError   = hPipeOutputWrite;

      CreateProcess (
            NULL, "CONSPAWN.EXE DOSAPP.EXE",
            NULL, NULL,
            TRUE, 0,
            NULL, NULL,
            &si, &pi);

      // Now that handles have been inherited, close it to be safe.
      // You don't want to read or write to them accidentally.
      CloseHandle(hPipeOutputWrite);
      CloseHandle(hPipeInputRead);

      // Now test to capture DOS application output by reading
      // hPipeOutputRead.  Could also write to DOS application
      // standard input by writing to hPipeInputWrite.

      while(TRUE)
      {
         bTest=ReadFile(
            hPipeOutputRead,      // handle of the read end of our pipe
            &szBuffer,            // address of buffer that receives data
            256,                  // number of bytes to read
            &dwNumberOfBytesRead, // address of number of bytes read
            NULL                  // non-overlapped.
            );

        if (!bTest){
            wsprintf(szMsg, "Error #%d reading pipe.",GetLastError());
            MessageBox(NULL, szMsg, "Test", MB_OK);
            break;
        }

        // do something with data.
        szBuffer[dwNumberOfBytesRead] = 0;  // null terminate
        MessageBox(NULL, szBuffer, "Test", MB_OK);
      }

      // Wait for CONSPAWN to finish.
      WaitForSingleObject (pi.hProcess, INFINITE);

      // Close all remaining handles
      CloseHandle (pi.hProcess);
      CloseHandle (hPipeOutputRead);
      CloseHandle (hPipeInputWrite);


没见输出
zgl7903 2014-02-25
  • 打赏
  • 举报
回复
VC6 MSDN上有例子

      SECURITY_ATTRIBUTES sa          = {0};
      STARTUPINFO         si          = {0};
      PROCESS_INFORMATION pi          = {0};
      HANDLE              hPipeOutputRead  = NULL;
      HANDLE              hPipeOutputWrite = NULL;
      HANDLE              hPipeInputRead   = NULL;
      HANDLE              hPipeInputWrite  = NULL;
      BOOL                bTest = 0;
      DWORD               dwNumberOfBytesRead = 0;
      CHAR                szMsg[100];
      CHAR                szBuffer[256];

      sa.nLength = sizeof(sa);
      sa.bInheritHandle = TRUE;
      sa.lpSecurityDescriptor = NULL;


      // Create pipe for standard output redirection.
      CreatePipe(&hPipeOutputRead,  // read handle
              &hPipeOutputWrite, // write handle
              &sa,      // security attributes
              0      // number of bytes reserved for pipe - 0 default
              );

      // Create pipe for standard input redirection.
      CreatePipe(&hPipeInputRead,  // read handle
              &hPipeInputWrite, // write handle
              &sa,      // security attributes
              0      // number of bytes reserved for pipe - 0 default
              );

      // Make child process use hPipeOutputWrite as standard out,
      // and make sure it does not show on screen.
      si.cb = sizeof(si);
      si.dwFlags     = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES;
      si.wShowWindow = SW_HIDE;
      si.hStdInput   = hPipeInputRead;
      si.hStdOutput  = hPipeOutputWrite;
      si.hStdError   = hPipeOutputWrite;

      CreateProcess (
            NULL, "CONSPAWN.EXE DOSAPP.EXE",
            NULL, NULL,
            TRUE, 0,
            NULL, NULL,
            &si, &pi);

      // Now that handles have been inherited, close it to be safe.
      // You don't want to read or write to them accidentally.
      CloseHandle(hPipeOutputWrite);
      CloseHandle(hPipeInputRead);

      // Now test to capture DOS application output by reading
      // hPipeOutputRead.  Could also write to DOS application
      // standard input by writing to hPipeInputWrite.

      while(TRUE)
      {
         bTest=ReadFile(
            hPipeOutputRead,      // handle of the read end of our pipe
            &szBuffer,            // address of buffer that receives data
            256,                  // number of bytes to read
            &dwNumberOfBytesRead, // address of number of bytes read
            NULL                  // non-overlapped.
            );

        if (!bTest){
            wsprintf(szMsg, "Error #%d reading pipe.",GetLastError());
            MessageBox(NULL, szMsg, "Test", MB_OK);
            break;
        }

        // do something with data.
        szBuffer[dwNumberOfBytesRead] = 0;  // null terminate
        MessageBox(NULL, szBuffer, "Test", MB_OK);
      }

      // Wait for CONSPAWN to finish.
      WaitForSingleObject (pi.hProcess, INFINITE);

      // Close all remaining handles
      CloseHandle (pi.hProcess);
      CloseHandle (hPipeOutputRead);
      CloseHandle (hPipeInputWrite);


rsdtt 2014-02-25
  • 打赏
  • 举报
回复
引用 1 楼 VisualEleven 的回复:
估计得涉及到管道通讯了。
但是我不能修改a.exe也能用管道吗
Eleven 2014-02-25
  • 打赏
  • 举报
回复
估计得涉及到管道通讯了。
「已注销」 2014-02-25
  • 打赏
  • 举报
回复
楼主先简单点来,比如试试运行你这个程序后,输出 %ERRORLEVEL% 看看这个程序在 success 和失败时的返回值是否不同。如果不同的话,你可以在运行完毕后直接读取环境变量的值来确定它是否执行成功。如果这个程序是你自己写的话,你可以在成功时返回零,创建进程可以 GetExitCodeProcess 取得返回值判断其是否成功执行。
赵4老师 2014-02-25
  • 打赏
  • 举报
回复
剽窃三楼:
#pragma comment(lib,"user32")
#include <stdio.h>
#include <windows.h>
int main() {
    SECURITY_ATTRIBUTES sa          = {0};
    STARTUPINFO         si          = {0};
    PROCESS_INFORMATION pi          = {0};
    HANDLE              hPipeOutputRead  = NULL;
    HANDLE              hPipeOutputWrite = NULL;
    HANDLE              hPipeInputRead   = NULL;
    HANDLE              hPipeInputWrite  = NULL;
    BOOL                bTest = 0;
    DWORD               dwNumberOfBytesRead = 0;
    DWORD               dwNumberOfBytesWrite = 0;
    CHAR                szMsg[100];
    CHAR                szBuffer[256];

    sa.nLength = sizeof(sa);
    sa.bInheritHandle = TRUE;
    sa.lpSecurityDescriptor = NULL;

    // Create pipe for standard output redirection.
    CreatePipe(&hPipeOutputRead,  // read handle
            &hPipeOutputWrite, // write handle
            &sa,      // security attributes
            0      // number of bytes reserved for pipe - 0 default
            );

    // Create pipe for standard input redirection.
    CreatePipe(&hPipeInputRead,  // read handle
            &hPipeInputWrite, // write handle
            &sa,      // security attributes
            0      // number of bytes reserved for pipe - 0 default
            );

    // Make child process use hPipeOutputWrite as standard out,
    // and make sure it does not show on screen.
    si.cb = sizeof(si);
    si.dwFlags     = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES;
    si.wShowWindow = SW_HIDE;
    si.hStdInput   = hPipeInputRead;
    si.hStdOutput  = hPipeOutputWrite;
    si.hStdError   = hPipeOutputWrite;

    CreateProcess (
          NULL, "cmd.exe",
          NULL, NULL,
          TRUE, 0,
          NULL, NULL,
          &si, &pi);

    // Now that handles have been inherited, close it to be safe.
    // You don't want to read or write to them accidentally.
    CloseHandle(hPipeOutputWrite);
    CloseHandle(hPipeInputRead);

    // Now test to capture DOS application output by reading
    // hPipeOutputRead.  Could also write to DOS application
    // standard input by writing to hPipeInputWrite.
    sprintf(szMsg, "dir *.txt /b\nexit\n");
    WriteFile(
          hPipeInputWrite,      // handle of the write end of our pipe
          &szMsg,               // address of buffer that send data
          18,                   // number of bytes to write
          &dwNumberOfBytesWrite,// address of number of bytes read
          NULL                  // non-overlapped.
          );

    while(TRUE)
    {
       bTest=ReadFile(
          hPipeOutputRead,      // handle of the read end of our pipe
          &szBuffer,            // address of buffer that receives data
          256,                  // number of bytes to read
          &dwNumberOfBytesRead, // address of number of bytes read
          NULL                  // non-overlapped.
          );

      if (!bTest){
          sprintf(szMsg, "Error #%d reading pipe.",GetLastError());
          MessageBox(NULL, szMsg, "WinPipe", MB_OK);
          break;
      }

      // do something with data.
      szBuffer[dwNumberOfBytesRead] = 0;  // null terminate
      MessageBox(NULL, szBuffer, "WinPipe", MB_OK);
    }

    // Wait for CONSPAWN to finish.
    WaitForSingleObject (pi.hProcess, INFINITE);

    // Close all remaining handles
    CloseHandle (pi.hProcess);
    CloseHandle (hPipeOutputRead);
    CloseHandle (hPipeInputWrite);

    return 0;
}

16,472

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧