Home › Forums › TWAIN Classic › Can’t get MSG_PROCESSEVENT param in Kodak-i1120 scanner
- This topic has 1 reply, 1 voice, and was last updated 10 years, 9 months ago by YogaV.
- AuthorPosts
I have tried to create app that should scan documents from both FUJITSU and Kodak-i1120 scanner. I could scanned the document using FUJITSU scanner and get the scanner image in memory trans mode.. everything has fine. I m using GetMessage() winapi function to get scanner message in order to stimulate the MSG_PROCESSEVENT (msg param), but in Kodak scanner I cannot stimulate the msg param for ‘MSG_PROCESSEVENT’ since GetMessage function does not return msg param. I have debugged my code once I reach the GetMessage() function the control flow will divert from my code block and kodak scanner scan the document automatically. So that I could not get the image handler at TWRC_XFERDONE stat.
Please suggest your idea.if ((bRet=GetMessage(&msg, NULL, 0, 0))!=0){ //–> here my problem is happening.
if(ProcessMessage(msg)){
//do the required work….
}
}BOOL CTwainAPI::ProcessMessage(MSG msg)
{
if(SourceEnabled())
{
//call winapi getmessage function and set the msg to tw_event.
TW_EVENT twEvent;
twEvent.pEvent = (TW_MEMREF)&msg;
twEvent.TWMessage = MSG_NULL;
CallTwainProc(&m_AppId,&m_Source,DG_CONTROL,DAT_EVENT,MSG_PROCESSEVENT,(TW_MEMREF)&twEvent);
if(GetRC() != TWRC_NOTDSEVENT)
{
TranslateMessage(twEvent);
return TRUE;
}
return FALSE;
}
return FALSE;
}Thanks,
Yoga VI found out the problem. 🙂 I have used the boost::thread for multi thread processing.
- AuthorPosts