views:

79

answers:

1

I have an application that allows me to scan images on my development PC which works successfully. It uses the Microsoft Windows Image Acquisition COM ActiveX dll. I am running VS2008 on Windows 7 64 bit.

I am having problems trying to deploy the Interop dll using ClickOnce. This component is referenced through the VS project in the normal way (and copy local = true). When I install the application on a Windows XP machine, I get an error saying that the library is missing (i.e. it wasn't installed / registered correctly). Having looked in the System32 directory, the dll is not there, so it has to be deployed via my app.

After looking on the web and trying various solutions, I then tried Microsoft's 'Registration-Free COM' method here: http://msdn.microsoft.com/en-us/library/ms165432%28VS.80%29.aspx

However, changing the Isolated property to True then caused 2 compilation errors due to duplicate entries in the registry. Having sorted out these entries out manually, I then deployed my app again with the supposedly isolated COM component, but when I try to scan a document I now get this message:

'The procedure entry point_except_handler4_common could not be located in the dynamic link library msvcrt.dll'

I feel like I'm going round in circles with this one. Can someone please enlighten me on how to deploy the WIA interop via ClickOnce for all versions of Windows from XP onwards?

Your help will be greatly appreciated.

Thanks

+1  A: 

Don't copy system DLLs from your Win7 machine to the XP machine, that can't work. It would have been easier if you named the file, I would guess at wiaaut.dll, the WIA Automation provider. It probably just isn't installed on the XP machine.

Ask the client to install this download on the machine. You don't need reg-free COM, these are system components.

Hans Passant
Thanks for the suggestion, but it doesn't really answer my question - I don't want to have manually install the dll on each and every PC where the app will be installed. I want to deploy the wiaaut.dll through the ClickOnce installer of my app, in case it is missing from the target machine. There must be a way to do this, as suggested by the reg-free COM.
JamesW
You cannot legally distribute Windows components.
Hans Passant
Okay... So, are you saying that the dll should already be present on XP pcs? If so then I guess I'll have to go down the manual install route. I've checked a few other XP pcs and the dll is missing from all of them, despite them being up to date. I thought that WIA was introduced from Windows ME onwards...
JamesW
You are using the automation layer, I'm fairly sure that was a later addition. That's why that download is available in the first place.
Hans Passant
Right, I see now. Having done the manual install on the target PC, it now works successfully. Thanks for your help. Are you certain it's illegal to distribute a free Windows component to another Windows installation? I've just noticed that Paint.NET definitely distributes it.... Therefore it has to be possible to build an application that includes the automation layer and distribute it automatically through ClickOnce.I've marked your answer as useful (which it has been), but I'll leave the question open for now in case anyone else has any pointers. Thanks again.
JamesW
Now marked as the answer. Thanks again for your help.
JamesW