Home › Forums › TWAIN Classic › Unable to process data source messages?
- This topic has 1 reply, 1 voice, and was last updated 13 years, 10 months ago by twainuser123.
Viewing 2 posts - 1 through 2 (of 2 total)
- AuthorPosts
Hi,
I am still new to TWAIN and am now at the stage of implementing the event loop (on windows Vista on MSVC++), but am running into problems.
Basically, TW_EVENT.TWMessage is always set to 0 using the below code:TW_EVENT curEvent;
curEvent.pEvent = (TW_MEMREF)curMesage;
//Ask the data source to fill 'curEvent'
DSM_Entry(&appIdentity, &curDataSource, DG_CONTROL, DAT_EVENT, MSG_PROCESSEVENT, (TW_MEMREF)&curEvent);
if (this->lastDSMReturnCode != TWRC_DSEVENT)
{ //This event does not belong to the data source (or there was a failure)
return true; //The application should process this message
}
if (curEvent.TWMessage)
{ //This line is never reached!!
return true;
}If it helps, I am new to Windows and am using
HWND appWindow = FindWindow(NULL, NULL);
to get the HWND for the application. The UI for the data source loads fine, but maybe this HWND is the problem?
I am targeting a command-line application so do not want to show a UI eventually.
Thanks in advance!
Nevermind…
I found out that I needed an event loop.
- AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)