I found here a tutorial for using NTWain to scan documents in C# WPF.
I tried the solution in an empty projet x86, it works good.
Now I'm tried to use this solution in my x64 project. First I had trouble with twainDSM.dll, so I downloaded the x64 version.
Now the project runs but there is no scanner in my list.
In code there is :
public TwainCore()
{
    //Allow old Device DSM drives
    PlatformInfo.Current.PreferNewDSM = false;
    var appId = TWIdentity.CreateFromAssembly(DataGroups.Image | DataGroups.Audio, Assembly.GetExecutingAssembly());
    _twainSession = new TwainSession(appId);
    PlatformInfo.Current.PreferNewDSM = false;
    _twainSession.TransferReady += _twainSession_TransferReady;
    _twainSession.StateChanged += _twainSession_StateChanged;
    if (_twainSession.Open() != ReturnCode.Success)
        throw new InvalidProgramException("Erreur de l'ouverture de la session");
}
I watched both :
- In x86 - _twainSession._ownedSources.Count= 1
- In x64 - _twainSession._ownedSources.Count= 0
So why there is no scanner found in my x64 project ?
 
    