3

I'm using VS2008 SP1 under Vista SP1. My .Net-program uses a COM reference to WIA (Microsoft Windows Image Acquisition Library v2.0). I'm using CommonDialogClass.ShowAcquireImage to scan a document and it's working fine. One of my customers is running XP. As I understand WIA, under XP you have to use WIALib (WIA 1.0). Is it possible to develop under Vista using WIA1?

Lars
  • 5,659
  • 1
  • 18
  • 21

3 Answers3

3

MS does allow you to download the WIA 2.0 library for XP here. That way your customer can use your app as is.

Also, I like WIA 2.0 more than 1.0.

Fred
  • 185
  • 1
  • 12
1

I setup a small WIALib-project with VS2008 under Windows XP and copied the created Interop.WIALib.dll to my Vista machine. When I reference this file in a C# project, I can compile it. Now I have two projects, one for XP and one for Vista. With a GetVersionEx-call I determine the running Windows-version in my C++-program and call the method of the adequate Dll.

Lars
  • 5,659
  • 1
  • 18
  • 21
-1

You can, in general. However, you will still need to have the WIA1 Dlls on your Vista system. The way I've done this in the past is to copy the WIA1 Dlls from XP to the XP box. I don't register the WIA1 dlls, but just reference them. By referencing them, your code now uses WIA1. In theory, you can still run and test on Vista because WIA2 should be backwards compatible with WIA1. Although you should test with XP just to be sure.

If you don't have another machine, I would recommend you take a look at VMWare so that you can install a new XP and get the Dlls that way.

Tommy Hui
  • 1,286
  • 6
  • 9
  • Thanks, I will test this tomorrow. Luckily I can install a machine with XP. Being honest, I run my Vista in a VM under Hyper-V on Windows Server 2008... – Lars Mar 24 '09 at 19:41
  • These are the Dlls I found on my XP: wiadefui.dll wiadss.dll wiascr.dll wiaservc.dll wiashext.dll wiavideo.dll wiavusd.dll None of them seems to be the one for "WIALib". Any suggestions? – Lars Mar 25 '09 at 09:43
  • I would use the "dumpbin.exe /exports wiadefui.dll" on each of those DLLs to see which one exports DllGetClassObject. This would indicate the DLL is a COM DLL. – Tommy Hui Mar 26 '09 at 14:23
  • Sadly, that doesn't work. Though some of the Dlls exports DllGetClassObject, I can't reference them. VS2008 says, I have to check if it's a valid assembly or COM-component (I only have german error messages, so I don't know "the original" one). I guess I will install a VS under XP... – Lars Mar 27 '09 at 10:52