|
결국 해결했습니다.
BOOL SetStdHandle(
DWORD nStdHandle, // input, output, or error device
HANDLE hHandle // handle to be a standard handle
);
Parameters
nStdHandle
Specifies the handle to be set. This parameter can have one of the following values: Value Meaning
STD_INPUT_HANDLE Standard input handle
STD_OUTPUT_HANDLE Standard output handle
STD_ERROR_HANDLE Standard error handle
hHandle
Supplies the handle to store as standard input, standard output, or standard error.
Return Values
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Julien 님이 쓰신 글 :
: 윈도어플에서 콘솔을 만들어 printf를 사용하여 출력할 수 있죠.
: 또 윈도어플에서 다른 콘솔프로세스를 생성하여 그 프로세스의 표준출력이나 표준에러를 윈도어플과 연결시켜서 콘솔프로세스의 출력을 받아올 수도 있죠.
: 이런 방법이 아닌
: 윈도어플내부에서 fprintf( stderr, ... ) 이 사용되고 있는 경우
: 자기 자신의 표준출력과 표준에러를 리다이렉션하려면 어떻게 해야할까요?
: 외부 라이브러리를 사용할 일이 있어서 프로젝트에 붙였는데
: 라이브러리 안에 fprintf( stderr, ... ) 을 사용한 부분이 있더군요.
: 그 부분에서 에러가 나서 프로그램을 더 이상 진행을 할 수가 없습니다.
: 관련글을 찾아보니 팁앤트릭에 임프님이 올린 글 중
: 콘솔어플의 표준출력과 표준에러에 대한 리다이렉션이 있더군요.
: 그걸 토대로 MSDN을 찾아보았으나 아직 답을 얻지 못하였습니다.
:
|