title: Why can't WIA see my scanner?
body: <p>I'm trying to use <a href="http://msdn.microsoft.com/en-us/library/ms630368(VS.85).aspx" rel="noreferrer">WIA (Microsoft Windows Image Acquisition Library v2.0) </a>to build a C# 3.5 WinForms app in VS2008 running on a Vista rig to aquire images from a scanner.</p>
  
  <p>I know there are plenty of SDKs out there that do this (Accusoft, ByteScout, Knowledge Lake, etc) but we wanted some control over the UI (or lack of) and the ability to customize the processing and handling of the images, which is why we're trying the WIA angle.</p>
  
  <p>However, I have been unable to get WIA to 'see' my scanner.</p>
  
  <p>The 'Microsoft Windows Image Acquisition Library v2.0' dll has been referenced in the VS project and I have included 'using WIA;' at the top of the page.</p>
  
  <p>Here is the section of code:</p>
  
  <pre><code>//Choose Scanner
  CommonDialogClass class1 = new CommonDialogClass();
  Device d = class1.ShowSelectDevice(WiaDeviceType.UnspecifiedDeviceType, true, false);
  if (d != null)
  {
      this.DeviceID = d.DeviceID;
  }
  else
  {
      //no scanner chosen
      return;
  }
  </code></pre>
  
  <p>Complies fine but line 2 (<em>Device d = ...</em>) kicks the following error when run:<br>
  <em>Exception from HRESULT: 0x80210015</em></p>
  
  <p>From what I can tell, this usually means your device is unplugged/not turned on or the device is not WIA compatible.<br>
  But the scanner in question shows up in Control Panel/Scanners and Cameras (means it's WIA compatible) and works when accessed via Photoshop (means it's turned on).    </p>
  
  <p>I have plugged in other devices (Digital SLR) and the above code can 'see' them, so the code is working.</p>
  
  <p>Does anyone have any suggestions as to what is going wrong and how to fix it?</p>
  
  <p><strong>Update 1</strong>:<br>
  I have tried a couple of different scanners (Canon 5000F, Benq 5250C), but same problem.  </p>
  
  <p><strong>Update 2</strong>:<br>
  I have been unable to find definitive proof of this, but I'm thinking that the scanners I have been testing with, or maybe <em>most</em> scanners :( , are not WIA compatible/supported.  I'm am now looking into using TWAIN, but would still love to hear of anyone who has had some success with WIA.</p>
  
  <p><strong>Update 3</strong>:
  Ended up ditching WIA and using a .NET Twain SDK (EZTwain).  All sorted now.  Thanks to everyone for thier input.</p>