Question

I am using C# to build a application in which I scan images through scanner using WIA.I am running into this error all the time

Creating an instance of the COM component with 
CLSID {850D1D11-70F3-4BE5-9A11-77AA6B2BB201} from the IClassFactory failed due 
to the following error: 80070422.

The error is on the following line

dlg = new CommonDialogClass();

I have set the reference to wiaaut.dll and even registered it , I have also Googled the problem for a while but to no avail. I am hoping that someone could solve or help me out with this. Any suggestions are welcome.

Was it helpful?

Solution

A quick search gave me the following answer:

http://mahaafifi.blogspot.co.uk/2012/03/iclassfactory-failed-due-to-following.html

and seems Jon Skeet already mentioned this answer in your previous question:

COMException was unhandled

Do the following:

  1. Click Start
  2. Click Run
  3. Type "services.msc"
  4. Select the service named "Windows Image Acquisition (WIA)". (See screenshot)
  5. Right click -> Properties
  6. Set startup type to "Automatic".
  7. Click OK to close the window
  8. Select the service again, right click -> Start.

The service is there but look for the full name, not the acronym or you might miss it.

The Windows Image Acquisition (WIA) service is now running and will start automatically after a reboot from now on.

enter image description here

If you still keep receiving exceptions after starting the service, then check if the user under which your application runs has enough rights to use the COM component.

When searching for error "80070422" I came accross the following fix:

http://windows.microsoft.com/en-US/windows7/Windows-Update-error-80070422

Might or might not be related, worth a try.

Also check the GUID and error code if you still receive exceptions after this.

For instance error code 0x80210015 usually signifies that your device, scanner in your case, is not WIA compliant. Update your drivers and check if they are WIA compliant! That or get a new scanner which is.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top