title: Twain Failure Description
body: <p>I am using Windows 8.1 x64
  After a long time search I could not find any answer for my question. I try to use Twain for scanning. My application works correctly in x86 mode. But for some reason, I'm now forced to switch to "<code>AnyCPU</code>". So that I'm trying to use new 'TWAINDSM.dll' instead of 'twain_32.dll'. But it fails while initializing: "<code>TwRC.Failure</code>" in:</p>
  
  <pre><code>    TwainNative.DSMparent(this._Appid, IntPtr.Zero, TwDG.Control, TwDAT.Parent, TwMSG.OpenDSM, ref hwndp);
  </code></pre>
  
  <p>which _Appid is</p>
  
  <pre><code>    this._Appid = new TwIdentity
                    {
                        Id = IntPtr.Zero,
                        Version = {MajorNum = 1, MinorNum = 1, Language = LanguageUSA, Country = CountryUSA, Info = "Mohammad"},
                        ProtocolMajor = TwProtocol.Major,
                        ProtocolMinor = TwProtocol.Minor,
                        SupportedGroups = (int)(TwDG.Image | TwDG.Control),
                        Manufacturer = "Kod Efisien Sdn Bhd",
                        ProductFamily = "TWAIN 32 Scanner",
                        ProductName = "ScanSoft"
                    };
  </code></pre>
  
  <p>in log file: </p>
  
  <blockquote>
    <p>[151040065 dsm.cpp   399   183 0000000000002174] TWAIN Working Group</p>
    
    <p>[151040065 dsm.cpp   400   183 0000000000002174] TWAIN 64 Source
    Manager (Image Acquisition Interface)</p>
    
    <p>[151040065 dsm.cpp   401   183 0000000000002174] version: 2, 3, 0, 0</p>
    
    <p>[151040065 dsm.cpp  2368   183 0000000000002174]  -> DSM</p>
    
    <p>[151040065 dsm.cpp  2377   183 0000000000002174]
    DG_CONTROL/DAT_PARENT/MSG_OPENDSM</p>
    
    <p>[151040065 apps.cpp  347   183 0000000000002174]   AppId.ProductName
    is empty</p>
    
    <p>[151040065 apps.cpp  654   183 0000000000002174]   Condition Code:
    Data parameter out of range</p>
    
    <p>[151040065 dsm.cpp  2432   183 0000000000002174] TWRC_FAILURE</p>
  </blockquote>
  
  <p>Thanks for any help.</p>