문제

Visual C ++ 2008에서는 여기에 표시된 것처럼 생성 된 예외를 "catch"하고 싶습니다.

try {
    int foo = 20;
    ::fgetpos(0, (fpos_t*)&foo);
}
//...
.

여기에 내가 성공적인 catch 시도를 시도하기 위해 만든 조정이 있습니다.

  1. SEH가 활성화 (/ EHA)
  2. catch (...) 를 추가했습니다.
  3. _set_se_translator 벡터.
  4. SEH 구문에 추가 / 조정했습니다. __ try / __except (예외 _Execute_Handler)

    짧은 시간에 "책의 모든 것"을 시도했고 아직도 예외를 잡을 수는 없습니다. ::fgetpos로 통화를 대체하면 int hey = foo / 0로 갑자기 위의 모든 기술이 예상대로 작동합니다. 따라서 ::fgetpos에서 다루는 예외는 어떻게 든 "특별한 특별"입니다.

    누군가 가이 이유를 설명 할 수 있습니다 :: FGOTPOS 오류가 해치되지 않는 것처럼 보이는지, 어떻게 해결 방법

    update VS IDE에서 실행될 때 출력 창에서 예외의 이름이 지정되지 않습니다. 그 모든 것이이게 :

    Microsoft Visual Studio C 런타임 라이브러리가 MyProgram.exe에서 치명적인 오류를 감지했습니다.

    별로 도움이되지 않습니다. 명령 줄에서 콘솔 응용 프로그램을 실행하면 충돌 대화가됩니다. 대화의 "문제 세부 정보"섹션에는이 정보가 포함됩니다.

    문제점 이름 : BEX
    예외 오프셋 : 0002FD30
    예외 코드 : C0000417
    예외 데이터 : 00000000
    추가 정보 1 : 69AD
    추가 정보 2 : 69DDFB19767B2221C8E3E7A5CD2F4AE
    추가 정보 3 : B1FF
    추가 정보 4 : B1FFCA30CADDDC78C19F19B6D150997F

도움이 되었습니까?

해결책

Since the code in your dump corresponds to STATUS_INVALID_CRUNTIME_PARAMETER, try _set_invalid_parameter_handler

다른 팁

Most likely, the runtime catches it for you and issues a debug dialog without returning or propagating the exception- that is a CRT call and they may add whatever exception catching code in there they like. It's well within Visual Studio's rights to catch a hardware exception inside a library function, especially if you are running from within the IDE or in debug mode, then it is expected of the runtime.

Of course, when you divide by zero, then there is no library call here to write that extra catching code.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top