Home › Forums › TWAIN Classic › hang when closing the scanner window
- This topic has 2 replies, 2 voices, and was last updated 16 years, 4 months ago by avnm.
- AuthorPosts
I am developing a dll to wrap twain.
I am developing it with microsoft visual c++ 2005.
The pattern i followed is inspired by the one in this codeproject articlehttp://www.codeproject.com/audio/twaintest.asp
To test the dll I developed an application with a form, and on the form I have the two buttons ‘select source’ and
‘acquire’. The ‘select source’ button works correctly. The ‘acquire’ button correctly displays the scanner window.
If I press the ‘scan’ button the image is correctly saved on the disk.
If I press the ‘close’ button the scanner window is closed, but the application hangs, and cpu usage goes to 100%.
The hang is caused by a call to the data source managerret_val = (*m_pDSMProc)(pOrigin,pDest,DG,DAT,MSG,pData);
whose purpose is probably to disable the data source or doing something like that .. sorry for my ignorance,
if needed i’ll try to be more precise.Thanks for your help.
few querstions,
Does your dll provide it’s own messagepump?
What are you doing in response to Msg_CloseDsReq & Msg_CloseDsOk?
Are you using native code only or are you compiling with cli support? – When you say ‘form’ do you mean .net or are you refering to a dialog?
The dll has a window in which we process messages, in the processing of messages, at the beginning, we have placed this code
if(msg.message == WM_GETDLGCODE)
return;and the problem has been solved.
In response to MSG_CLOSEDSREQ i am closing the data source, it seems there is not action for MSG_CLOSEDSOK.
When i say ‘form’ i am referring to a dialog.
- AuthorPosts