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
[47428] Re:Setting start directory on CreateProcess??
alex [] 1371 읽음    2006-12-18 08:35
WinExec, ShellExec, systerm or CreateProcess ..
None of them working for initial directory and create a bat file in run time and run it..

alex 님이 쓰신 글 :
: This process shoul be start from certain directory but this is not working ..
: Anything wrong??
:
:
: BOOL CreateProcess(
:   LPCTSTR lpApplicationName,
:   LPTSTR lpCommandLine,
:   LPSECURITY_ATTRIBUTES lpProcessAttributes,
:   LPSECURITY_ATTRIBUTES lpThreadAttributes,
:   BOOL bInheritHandles,
:   DWORD dwCreationFlags,
:   LPVOID lpEnvironment,
:   LPCTSTR lpCurrentDirectory, //**this
:   LPSTARTUPINFO lpStartupInfo,
:   LPPROCESS_INFORMATION lpProcessInformation
: );
:
: //**this should be the start directory but it does work for me..
:
:     char buffer[546];
:     sprintf(buffer, "\"%s\" \"%s\"", sPath.c_str(), m_sDumpscript.c_str() );
:
:     char dir[546];
:     sprintf(dir, "\"%s\"", edtDataDir->Text.c_str());
:
:     //this should run on Data directory
:     // Start the child process.
:     BOOL bResult = CreateProcess( NULL, // No module name (use command line).
:             buffer, // Command line.
:             NULL,             // Process handle not inheritable.
:             NULL,             // Thread handle not inheritable.
:             FALSE,            // Set handle inheritance to FALSE.
:             0,                // No creation flags.
:             NULL,             // Use parent's environment block.
:             dir,              // Use parent's starting directory.
:             &si,              // Pointer to STARTUPINFO structure.
:             &pi )  ;           // Pointer to PROCESS_INFORMATION structure.

+ -

관련 글 리스트
47405 Setting start directory on CreateProcess?? alex 907 2006/12/14
47428     Re:Setting start directory on CreateProcess?? alex 1371 2006/12/18
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.