// SampleZoneSink.cpp : implementation file // #include "stdafx.h" #include "msvc5ocr.h" #include "SampleZoneSink.h" #include "MSVC5OCRView.h" #include "VerifyDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CSampleZoneSink IMPLEMENT_DYNCREATE(CSampleZoneSink, CCmdTarget) CSampleZoneSink::CSampleZoneSink() { EnableAutomation(); } CSampleZoneSink::~CSampleZoneSink() { } void CSampleZoneSink::OnFinalRelease() { // When the last reference for an automation object is released // OnFinalRelease is called. The base class will automatically // deletes the object. Add additional cleanup required for your // object before calling the base class. CCmdTarget::OnFinalRelease(); } BEGIN_MESSAGE_MAP(CSampleZoneSink, CCmdTarget) //{{AFX_MSG_MAP(CSampleZoneSink) // NOTE - the ClassWizard will add and remove mapping macros here. //}}AFX_MSG_MAP END_MESSAGE_MAP() BEGIN_DISPATCH_MAP(CSampleZoneSink, CCmdTarget) //{{AFX_DISPATCH_MAP(CSampleZoneSink) DISP_FUNCTION_ID(CSampleZoneSink,"Verification",1,OnVerification,VT_EMPTY,VTS_I2 VTS_WBSTR) //}}AFX_DISPATCH_MAP END_DISPATCH_MAP() BEGIN_INTERFACE_MAP(CSampleZoneSink, CCmdTarget) INTERFACE_PART(CSampleZoneSink, DIID__LTZoneDataEvents, Dispatch) END_INTERFACE_MAP() ///////////////////////////////////////////////////////////////////////////// // CSampleZoneSink message handlers void CSampleZoneSink::OnVerification(short iZoneIndex, BSTR bstrWord) { if (m_pView->m_bAccpetAll) { m_pView->m_pZoneData->VerifyCode = VF_ACCEPT; m_pView->m_pZoneData->StopVerificationEvent = TRUE; BeginWaitCursor(); return; } CVerifyDlg vDlg(iZoneIndex, bstrWord); EndWaitCursor(); if (vDlg.DoModal() == IDOK) { m_pView->m_pZoneData->VerifyCode = vDlg.m_VerifyCode; m_pView->m_bAccpetAll = vDlg.m_bAccpetAll; m_pView->m_pZoneData->StopVerificationEvent = FALSE; } else m_pView->m_pZoneData->StopVerificationEvent = TRUE; BeginWaitCursor(); }