Hi,
I need to use WIA (Windows Image Acquisition) from managed C++. Is there a
"new and improved" way to access WIA from managed C++ (i.e., through .net)?
Or, is it the same COM calls as from unmanaged C++?
If it's the same COM calls, is there a "new and improved" way to access COM
through managed C++? Or, do I do the same CComPtr magic as with unmanaged
C++? Or, can I not use ATL facilities from managed C++ and I would have to
regress all the way back to ::CoCreateInstance() et. al.?
Thanks for any help! The best I can find in the docs suggests I need a
Primary Interop Assembly for WIA in order to use .NET Interop but I can't
find a PIA for WIA so I must be on the wrong track.
Thanks,
Ryan
Ryan Melville - 24 May 2005 14:53 GMT
I figured it out.
For posterity:
- Use Visual Studio "Add Reference"...
- Select COM tab.
- Select "Microsoft Windows Image Acquisition".
- This will generate some objects in an Interop::WIALib namespace.
You can then do something like this:
WiaClass* pWia = new WiaClass();
int iCnt = pWia->Devices->Count;
See the WIA documentation and use the "Open" menu item from the right-click
menu of the WIALib reference in your project to see documentation on the
generated classes/interfaces/et. al.
Seems to work well.
Ryan
> Hi,
>
[quoted text clipped - 13 lines]
> Thanks,
> Ryan