MFC 등으로 프로그래밍 하신 모양이네요? assertion은, 부적절한 상황에 닥치면 일부러 프로그램이 멈추게 하는 기능입니다.
음.. retry누르면 아마 해당 부분에서 디버그 브레이크가 걸려 있을테니 침착하게 상황을 파악해보세요.
그리고, 코딩 중에도, 왠지 실수할만한 부분에서 assertion을 자주 사용해주는것도 좋은 방법입니다.
2006.05.05 11:46:02 (*.118.69.84)
박현만
자세한 상황설명을 해주시면 좀더 조언해드릴 수 있을듯한데요. debug assertion failed 는 저도 경험해봐서 제 경험을 얘기해드리겠습니다. 제 경험상 저런 경우 90%가 다음과 같은 경우였습니다.
어떤 클래스의 객체나 등을 가지고 함수도 호출하는 등 프로그램 내에서 사용하는데 그 객체나 등이 메모리상에 존재하지 않는데 사용하는 경우에 저 debug assertion failed가 떳었습니다.
예를들어보겠습니다. CDialog* g_dlg라는 객체를 전역으로 선언해놓고 어떤 함수의 내부에서 CDialog dlg; 있고 dlg에 값이 설정되고 g_dlg = &dlg 라고 했습니다. 그리고 그 함수를 빠져나오고 다른
함수에서 g_dlg를 가지고 어떤 작업을 위해 사용할때 g_dlg가 가리키고 있는 곳은 엉뚱한 부분이 되는거죠.
제 경험상 위의 경우가 대부분이었구요. 물론 다른 경우일 수도 있습니다. 안군님 말씀처럼 상황을 잘 파악해보시고 디버깅해보시기 바랍니다. 프로그램의 완성은 디버깅으로 마무리된다 라고 생각합니다^^
음.. retry누르면 아마 해당 부분에서 디버그 브레이크가 걸려 있을테니 침착하게 상황을 파악해보세요.
그리고, 코딩 중에도, 왠지 실수할만한 부분에서 assertion을 자주 사용해주는것도 좋은 방법입니다.