TWAIN Working Group

Newsletter Signup
Donate
Help keep TWAIN free
  • About TWAIN
    • What’s New?
    • News
    • Events
    • Membership
    • Consider a Donation
    • Contact Us
  • Why TWAIN?
  • Developers
    • Driver Developer
    • Application Developer
    • TWAIN Features
    • Specification & Tools
    • Self Certification Process
  • Support Forums
  • Scanner End-User
  • Find Certified Drivers
    • Facebook
    • LinkedIn
    • Vimeo

DSMParent method is freezing

Forums › TWAIN Classic › DSMParent method is freezing

  • This topic has 1 reply, 2 voices, and was last updated 7 years, 7 months ago by MarkM.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • June 7, 2013 at 12:20 pm #22851 Reply
    srirangamk
    Participant
    • Topics - 1
    • Replies - 0
    • Total Posts - 1

    Hi,
    In my code, I am trying to code find out whether scanner is attached to the computer. In case if the scanner is attached, I should enable “Scan” button in my application. In order determine whether Scanner is attached to the machine, I am using the Twain API. Twain API DSMParent is not returning at all. Since I am calling this method from UI thread, my application is freezing. So I should close my application through task manager only. So could anybody help me, what DSMParent API is internaly doing and is there any possibility that this method may freeze?

    It is freezing only on this machine. In other machines it is working fine without any issues.
    Since it is unmanaged code, if I know the internals of DSMParent method, atleast I can try to diagnose some thing. Please let me know either internals of this API or the cause for API not returning.

    Machine Description:

    OS – Windows 7 – 64 Bit
    Dll used – Twain_32.dll
    Method used: TwRC rc = DSMparent(appid, IntPtr.Zero, TwDG.Control, TwDAT.Parent, TwMSG.OpenDSM, ref hwndp);

    Call Stack where the method frozen:

    004ad978 74e79eb2 [NDirectMethodFrameSlim: 004ad978] Liberty.Framework.NetExchangePro.DocumentMgmt.Twain.(appid, IntPtr, Liberty.Framework.NetExchangePro.DocumentMgmt.TwDG, Liberty.Framework.NetExchangePro.DocumentMgmt.TwDAT, Liberty.Framework.NetExchangePro.DocumentMgmt.TwMSG, IntPtr ByRef)
    004ad998 156a2f56 Liberty.Framework.NetExchangePro.DocumentMgmt.Twain.(IntPtr)
    004ad9c8 156a2ef5 Liberty.Framework.NetExchangePro.DocumentMgmt.Twain.Init(IntPtr)
    004ad9cc 0e88b8f2 Liberty.Framework.NetExchangePro.DocumentMgmt.DocumentUpload.(System.Object, System.EventArgs)
    004ada70 04f7006d [MulticastFrame: 004ada70] System.EventHandler.Invoke(System.Object, System.EventArgs)
    004ada84 5b1846a5 System.Windows.Forms.Form.OnLoad(System.EventArgs)
    004adab8 5b184145 System.Windows.Forms.Form.OnCreateControl()
    004adac4 5b176d71 System.Windows.Forms.Control.CreateControl(Boolean)
    004adb00 5b176b74 System.Windows.Forms.Control.CreateControl()
    004adb18 5b183008 System.Windows.Forms.Control.WmShowWindow(System.Windows.Forms.Message ByRef)
    004adb54 5b178966 System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message ByRef)

    June 11, 2013 at 7:48 pm #25907 Reply
    MarkM
    Participant
    • Topics - 1
    • Replies - 135
    • Total Posts - 136

    Howdy…

    TWAIN_32.DLL is proprietary, it’s also really old. The TWAIN Working Group maintains a newer, fully plug compatible open source version of the Data Source Manager. You can find it here: http://sourceforge.net/projects/twain-dsm

    The file is named TWAINDSM.DLL, and it is placed into C:WindowsSystem32. You can download the source code from the same site and build a debug copy, and examine what is happening when you’re issuing commands from your application.

    The only change you need to make to your application is to link to or load TWAINDSM.DLL instead of TWAIN_32.DLL. I’m not sure if the framework you’re using will let you do this. If not, you may want to contact them about adding it as an option.

    If that’s not an option, then I recommend backing up your system, and then going into C:WindowsTWAIN_32. Check to see how many TWAIN drivers you have installed. If it’s more than one, then move all but one from out of the TWAIN_32 directory, and see if there is still a problem. Do this for each driver. You may be running into an issue with one of the drivers, and this can help spot the one causing the trouble.

    (good luck)

    — Mark

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: DSMParent method is freezing
Your information:




Quick Links

Service Providers
TWAIN Support Forums
Membership
Contact Us
Privacy Policy

Newsletter Signup

TWAIN Working Group Family

TWAIN Working Group
TWAIN Direct®
TWAIN Resources
TWAIN Certified Drivers
PDF/raster

  • Facebook
  • GitHub
  • LinkedIn
  • Vimeo

Recent Topics

  • EPSON V600 TWAIN and WIA on Windows 10
  • When and how to use WaitForEvents command ?
  • Problem enumerating list of installed scanners in windows server 2012
  • Failed to create TWAIN progress! Error code is 1260.
  • To get the list of scanners from javascript client side (browser)
  • Quarterly Newsletter
  • TWAIN Working Group Membership
  • Logo Usage
  • TWAIN License
  • Contact Us
Privacy Policy • Privacy Tools • Copyright © 2021 TWAIN Working Group • by iHwy, LLC • Log in

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.