开发者

Showing Image Acquisition's Device Interface

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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜