System.AccessViolationException

Issue #45 new
Alex created an issue

When i try to _session.Open(); then catch System.AccessViolationException в NTwain.Triplets.Dsm.NativeMethods.DsmWinNew(TWIdentity origin, TWIdentity destination, DataGroups dg, DataArgumentType dat, Message msg, IntPtr& data) в NTwain.Triplets.Dsm.DsmEntry(TWIdentity origin, TWIdentity destination, DataGroups dg, DataArgumentType dat, Message msg, IntPtr& data) в c:\Users\Eugene\Desktop\Code\NTwain\src\NTwain\Triplets\Dsm.cs:строка 30

Comments (6)

  1. Eugene Wang repo owner

    Would need more info. Are you testing the sample apps or your own app? Winform or wpf? 32bit or 64bit? Using a reasonably updated twaindsm.dll? Running in debug or release mode with debugger attached? Sometimes release mode with debugger can have access violation exception that doesn't occur without debugger (i.e. works when running the exe directly).

  2. Alex reporter

    Are you testing the sample apps or your own app? own Winform or wpf? wpf 32bit or 64bit? Anycpu, debug on x86 Using a reasonably updated twaindsm.dll? non updated. Can you get link on dll,then you used? Running in debug or release mode with debugger attached? Debug, yeap Sometimes release mode with debugger can have access violation exception that doesn't occur without debugger (i.e. works when running the exe directly). (((

  3. Alex reporter

    put in output version 2.3.0. It did not help. (System.AccessViolationException). exception on 1 of 5-7 times

    Put option.

    NTwain.PlatformInfo.Current.PreferNewDSM = false;
    

    The client does not respond

    Could there be a problem (of System.AccessViolationException) in the parallel access to twain api from different domains (different instances of programs)?

  4. Eugene Wang repo owner

    There's no code limit in multiple app instances (from ntwain or twain dsm). The scanner driver may limit one open connection to it for obvious reasons but it shouldn't result in that exception.

  5. Grant Kadokura

    Hi Eugene,

    I've been getting the same issue and wondering if this ever got resolved. Working through the winforms sample with v2.3.0 twaindsm.dll, x86 on a 64bit machine in debug.

  6. Log in to comment