Wednesday, August 20, 2014

Registering a DLL file

The application I am working on uses Windows Image Acquisition 2.0 to access and control a scanner.  The problem was that after I installed and then uninstalled the program, I kept getting the error 'WIA' is not declared. It may be inaccessible due to its protection level. That should have been easy enough to fix, just reference the Microsoft Windows Image Acquisition Library v2.0.  The problem was that it wasn't there.  (Or at least I couldn't see it.)  I finally figured out that Gary didn't have version 2.0 on his XP computer and had to get a copy and register it separately.  When the program was installed, it registered the wiaaut.dll file to the one Gary included in the program files instead of the system32 folder.  As soon as I uninstalled the program, there went my reference to "WIA".  To fix the problem, I had to re-register the copy that was still in the system32 folder.  After I rebuilt the program, we also had to re-register wiaaut.dll on all the computers the program was installed on.



Here is how to do it.
  1. From the start bar, type cmd in the search field (don't hit enter)
  2. Right click cmd.exe and run as administrator (goes directly to system32 folder)
  3. At the prompt type: regsvr32 wiaaut.dll (hit enter)
To unregister the same dll
  1. Pull up the same cmd prompt
  2. At the prompt type: regsvr32 /u wiaaut.dll

No comments:

Post a Comment