Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / May 2005

Tip: Looking for answers? Try searching our database.

Windows Image Acquisition from managed C++?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ryan Melville - 22 May 2005 23:07 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.