Home › Forums › TWAIN Classic › Scanner Messages do not arrive in MFC
- This topic has 3 replies, 2 voices, and was last updated 14 years, 11 months ago by ancient_nerd.
- AuthorPosts
I am writing a Dialog Based VC++6.0 MFC application and trying to talk to an HP Scanject 3970. When I send ENABLEDS, I geet a good return code, The scanners UI pops up and scans a preview like it should. When I press the accept button in the UI, it should start the real scan, but nothing happens.
In my override of PretranslateMessage by setting the right breakpoint, I can tell that DG_CONTROL, DAT_EVENT, MSG_PROCESSEVENT always returns TWRC_NOTDSEVENT. It looks like the scanners messages must be getting lost somewhere.
Is it okay to set my TW_USERINTERFACE’s hParent to the m_hWnd field of my CDialog directly? Or is there something else I need? It looks like:CWnd &wnd
TW_USERINTERFACE m_ui;
m_ui.hParent = wnd.m_hWnd;
m_ui.ShowUI = mode != dis_ui;
m_ui.ModalUI = mode == modal_ui;
TW_UINT16 rc = mfp_dsm (&m_app, &m_src, DG_CONTROL, DAT_USERINTERFACE, MSG_ENABLEDS, &m_ui);It turns out that there are two different versions of twain_32.dll on my system. The LoadLibrary Call in the Twain Specification finds C:/Windows/System32/twain_32.dll. The scanner was trying to send XferReady by loading the newer version, C:/Windows/twain_32.dll.
@ancient_nerd wrote:
It turns out that there are two different versions of twain_32.dll on my system. The LoadLibrary Call in the Twain Specification finds C:/Windows/System32/twain_32.dll. The scanner was trying to send XferReady by loading the newer version, C:/Windows/twain_32.dll.
How did you resolve this problem?
I renamed the older version of twain_32.dll to something else. When the LoadLibrary call did not find it in Windows/System32, the next place for it to look is C:/Windows.
- AuthorPosts