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?
相关问题
- Generic Generics in Managed C++
- How to Debug/Register a Permanent WMI Event Which
- 'System.Threading.ThreadAbortException' in
- Bulk update SQL Server C#
- Should I use static function in c# where many call
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.
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.
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.