C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[23907] 빌더 프로젝트에서 _popen 함수를 호출할 수 없군요.
정장혁 [] 570 읽음    2003-01-27 19:41
VCL 로 프로그램을 만들다,stdio 함수인 _popen를 호출 했는데, 무조건 NULL값만 반환 하는 군요.
혹시 뭘 빼먹었는지 궁금합니다.

void __fastcall TWebMonitorForm::BitBtn4Click(TObject *Sender)
{
  FILE* handle;        // handle to one end of pipe
  char message[256];   // buffer for text passed through pipe
  int status;          // function return value

  // open a pipe to receive text from a process running "DIR"

  handle = _popen("dir /b", "rt");
  if (handle == NULL)
  {
    ShowMessage("_popen error");
  }

  // read and display input received from the child process
  while (fgets(message, sizeof(message), handle))
  {
    ShowMessage( message);
  }

  // close the pipe and check the return status
    status = _pclose(handle);
  if (status == -1)
  {
    ShowMessage("_pclose error");
  }


}

+ -

관련 글 리스트
23907 빌더 프로젝트에서 _popen 함수를 호출할 수 없군요. 정장혁 570 2003/01/27
23912     Re:빌더 프로젝트에서 _popen 함수를 호출할 수 없군요. 정장혁 573 2003/01/27
23911     Re:빌더 프로젝트에서 _popen 함수를 호출할 수 없군요. 정장혁 544 2003/01/27
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.