473,807 Members | 2,823 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Windows Image Acquisition from managed C++?

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 ::CoCreateInsta nce() 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

Nov 17 '05 #1
1 2140
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

"Ryan Melville" <re************ *****@gmail.com > wrote in message
news:ej******** *****@TK2MSFTNG P12.phx.gbl...
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 ::CoCreateInsta nce() 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

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2126
by: Daniel Wilson | last post by:
I am replacing an ActiveX OCX that was created in VB6. It is used heavily in a large VB6 program that I do not have the luxury of upgrading to .NET. The new control must use a significant amount of code that was written in C++ .NET for a web service. In C++ .NET, I have the option of creating an MFC ActiveX Control. That control loads onto a VB6 form just fine. But when I start including .NET managed code, I run into compile errors.
0
1563
by: dicky2283 | last post by:
windows development community please help me im deepak roy , doing my final year undergrad in computer science.... im doing a project - Motion detection and Tracking in vc++( video for windows). The project combines image acquisition, manipulation techniques with other image processing techniques and neural network approaches. im using video for windows to capture images from a webcam( EZONICS CAM II ). if u have used video for windows,...
3
7466
by: Bob | last post by:
Gidday, Anyone in here used WIA before? I want to be able to connect to a digital camera via USB and access the images. I was hoping WIA would be all I need but it doesn't see my camera (Sony DSC-F717). Does the camera being used need some kind of compliant driver? Or should any XP-recognised digital camera work? I know I can tap into the supplied software that came with the camera but
6
2806
by: Bob | last post by:
Hi, Can anybody who has used Windows Image Acquisition library 2.0 for XP tell me how to get it to scan ALL documents loaded in the document feeder of a scanner. I have only ever used it to do an image at a time but now need to be able to process as many pages as are loaded. Any useful info appreciated...
19
2245
by: **Developer** | last post by:
When I get the image from the file the file remains locked so the Delete fails with a "used by another process" So I tried using a clone and disposing the obtained image. But that didn't fix the problem. Can you help?
3
5720
by: Roberto Hernández | last post by:
I try to use the Windows Image Acquisition (WIA) with a sample in vb.net but it takes only back photos and also at low resolution. How can I put ther resolution at 640x480? I have a Labtec webcam plus that works fine with other software. I downloaded two samples from the internte and both of them do the same problem The samples are: http://www.vbforums.com/showthread.php?t=378126 http://www.vbforums.com/attachment.php?attachmentid=44367...
3
12194
by: Nicholas Lee | last post by:
I am using Visual Studio 2005 and wish to program using managed C++ code. I am writing an application to take still images from a webcam. I have created an interop 'reference' to the platform SDK dll for Windows Image Acquisition (WIA). This has created a set of classes under "Interop.WIALib.1.0.dll" Here is the bewildering set of classes it creates: WIALib::CollectionClass
4
26294
by: ink | last post by:
Hi All, I am trying to build an image capture user control using DirectShow to be used in an existing C# application. It needs to have a view finder/ preview window and be able to take still images.
0
995
by: tavares | last post by:
----------------------------------------------------------------------------------------------------------------------------------- (Apologies for cross-posting) International ECCOMAS Thematic Conference VipIMAGE 2009 - II ECCOMAS THEMATIC CONFERENCE ON COMPUTATIONAL VISION AND MEDICAL IMAGE PROCESSING 21-23th October 2009, FEUP, Porto, Portugal www.fe.up.pt/~vipimage
0
9599
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10624
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10374
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10111
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9193
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5546
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4330
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3853
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3010
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.