CTwain : With ActiveX control. It does not working ! . Help me please.
-
see this link first : http://www.codeproject.com/audio/twaintest.asp I used CTwain from there. I included CTwain with my ActiveX control. When i call selectSource it worked. When i call Acquire , the source's user interface is displayed. But the following condition in ProcessMessage(MSG msg) is not become true when clicking on Close(Cancel or Exit) , Ok (or Scan). if(GetRC() != TWRC_NOTDSEVENT) { AfxMessageBox(_T("In TWRC_NOTDSEVENT in ProcessMessage" )); // it not executed always TranslateMessage(twEvent); } Thus TranslateMessage is not called. I subclassed my control class from CTwain. and in OnCreate i included the following line. InitTwain(m_hWnd); if(!IsValidDriver()) { AfxMessageBox("Unable to load Twain Driver."); } and in PreTranslateMessage (BOOL CImgAnnCtrl::PreTranslateMessage(MSG* pMsg)) i included the following line. ProcessMessage(*pMsg); Plese help me. What is the problem. I followed the same procedure in a stand alone(exe (mfc)) application it worked well.