From bd13fa3f9396f1f681759f4623c55d5f91d74a9c Mon Sep 17 00:00:00 2001
From: LYW <leeyeanwoo@diteam.co.kr>
Date: 목, 29 7월 2021 11:42:19 +0900
Subject: [PATCH] Ongoing90 #3524 CF AOI Review 디포커스 알람 추가 및 FDC 보고 방식 개선

---
 ReviewSystem/ReviewSystem/stdafx.h |   31 ++++++++++++++++++++++++++++++-
 1 files changed, 30 insertions(+), 1 deletions(-)

diff --git a/ReviewSystem/ReviewSystem/stdafx.h b/ReviewSystem/ReviewSystem/stdafx.h
index adcb7cf..d482171 100644
--- a/ReviewSystem/ReviewSystem/stdafx.h
+++ b/ReviewSystem/ReviewSystem/stdafx.h
@@ -38,6 +38,9 @@
 #include "CHReviewResult/GlassResult.h"
 #include "CHReviewSetting/MotorParameter.h"
 
+#include <DbgHelp.h> 
+#pragma comment ( lib, "DbgHelp" )
+
 #include <WinNetWk.h>
 //#pragma comment(lib,"Mpr.lib")
 
@@ -403,4 +406,30 @@
 	char			strMessageString[MAX_PATH];
 };
 
-BOOL KillProcess(CString ProcessName);BOOL getStateProcess(CString ProcessName);
\ No newline at end of file
+BOOL KillProcess(CString ProcessName);BOOL getStateProcess(CString ProcessName);
+
+// �꽑�뼵 
+static LONG CALLBACK TopLevelExceptionFilterCallBack(EXCEPTION_POINTERS* exceptionInfo);
+
+LONG CALLBACK TopLevelExceptionFilterCallBack(EXCEPTION_POINTERS * exceptionInfo)
+{
+	MINIDUMP_EXCEPTION_INFORMATION dmpInfo = { 0 };
+	dmpInfo.ThreadId = ::GetCurrentThreadId(); // Threae ID 
+	dmpInfo.ExceptionPointers = exceptionInfo; // Exception Info 
+	dmpInfo.ClientPointers = FALSE;
+	CTime time;
+	CString strStamp;
+
+	SYSTEMTIME   currentTime;
+	::GetLocalTime(&currentTime);
+	time = CTime::GetCurrentTime();
+	strStamp.Format(_T("Dump\\%02d_%02d_%02d_%02d_%02d_%02d.dmp"), time.GetYear(), time.GetMonth(), time.GetDay(), time.GetHour(), time.GetMinute(), time.GetSecond());
+
+	HANDLE hFile = CreateFile(strStamp, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+
+	// �뜡�봽 �깮�꽦
+	BOOL bWrite = ::MiniDumpWriteDump(::GetCurrentProcess(), ::GetCurrentProcessId(), hFile, MiniDumpNormal, &dmpInfo, NULL, NULL);
+
+	return 0L;
+
+}
\ No newline at end of file

--
Gitblit v1.9.3