显示图像采集的设备接口
我正在使用 TWAIN 2.1,连接到扫描仪,让用户更改任何选项,然后等待输入,每当扫描仪界面显示问题时,光标仍然给出有关某些循环或工作的指示,,,这是以下代码:
HWND g_hwnd = CreateWindow ("STATIC",
"",
WS_POPUPWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
HWND_DESKTOP,
0,
g_hinstDLL,
0);
TW_USERINTERFACE ui;
ui.ShowUI = TRUE;
ui.ModalUI = TRUE;
ui.hParent = g_hwnd;
// g_pDSM_Entry ->
int code = (*g_pDSM_Entry) (&g_AppID,
&g_SrcID,
DG_CONTROL,
DAT_USERINTERFACE,
MSG_ENABLEDSUIONLY,
(TW_MEMREF) &ui);
if(TWRC_SUCCESS != code) {
return;
}
MSG msg;
while(GetMessage ((LPMSG) &msg, g_hwnd, 0, 0)){
// TO-DO
}
如何等待用户输入?而且对话框也不出现,只有白色窗口?
I'm using TWAIN 2.1, to connect to Scanner, let user change any option, and wait for input, the problem whenever the scanner interface shows, the cursor still give indication about certain loop, or working,,, this is the following code:
HWND g_hwnd = CreateWindow ("STATIC",
"",
WS_POPUPWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
HWND_DESKTOP,
0,
g_hinstDLL,
0);
TW_USERINTERFACE ui;
ui.ShowUI = TRUE;
ui.ModalUI = TRUE;
ui.hParent = g_hwnd;
// g_pDSM_Entry ->
int code = (*g_pDSM_Entry) (&g_AppID,
&g_SrcID,
DG_CONTROL,
DAT_USERINTERFACE,
MSG_ENABLEDSUIONLY,
(TW_MEMREF) &ui);
if(TWRC_SUCCESS != code) {
return;
}
MSG msg;
while(GetMessage ((LPMSG) &msg, g_hwnd, 0, 0)){
// TO-DO
}
How can wait for user input?also the dialog doesn't appear, just white window?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你考虑过EZTwain吗? 非常易于使用
http://www.dosadi.com/eztwain1.htm
它是免费的,并且 你的情况,我认为问题在于没有实现
// TO-DO
。 TWAIN 使用消息循环进行通信,Windows 也是如此(例如绘制对话框)。我假设你的循环实际上正在做更多的事情,但如果没有,你需要允许消息被泵送。
Have you considered EZTwain? It's free and very easy to use
http://www.dosadi.com/eztwain1.htm
In your case, I think the problem is with not implementing the
// TO-DO
. TWAIN uses the message loop to communicate, and so does Windows (to draw dialogs, for example).I assume that your loop is actually doing something more, but if not, you need to allow messages to be pumped.