G
Guest
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
WIALib:eviceInfoClass
WIALib::ItemClass
WIALib::SafeWiaClass
WIALib::WiaClass
WIALib::Collection
WIALib:eviceInfo
WIALib::ICollection
WIALib::Item
WIALib::IWia
WIALib::IWiaDeviceInfo
WIALib::IWiaDispatchItem
WIALib::SafeWia
WIALib::Wia
WIALib::WiaProtocol
WIALib::WiaDeviceInfoPropertyId
WIALib::WiaFlag
WIALib::WiaIntent
WIALib::WiaItemPropertyId
Unfortunately I have no idea how to use these generated classes because
there appears to be no documentation other than for the original COM class
library and and that documentation only relates to unmanaged code that makes
use of pointers and interfaces.
My semi-random stab at getting it to take a picture is as follows.
Needless to say, this code does not work, so your help in correcting the
code or explaining how the classes work would be most appreciated.
using namespace WIALib;
WiaClass^ myWia = gcnew WiaClass();
int iCnt = myWia->Devices->Count;
Collection^ myDeviceInfo = myWia->Devices;
Collections::IEnumerator^ myEnumerator = myDeviceInfo->GetEnumerator();
myEnumerator->MoveNext();
IWiaDeviceInfo^ myDev = (IWiaDeviceInfo^)myEnumerator->Current;
Item^ myItem = myDev->Create();
if (myItem->ConnectStatus=="connected")
{
myItem->TakePicture();
myItem->Transfer("clipboard",false);
}
Regards,
Nicholas Lee
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
WIALib:eviceInfoClass
WIALib::ItemClass
WIALib::SafeWiaClass
WIALib::WiaClass
WIALib::Collection
WIALib:eviceInfo
WIALib::ICollection
WIALib::Item
WIALib::IWia
WIALib::IWiaDeviceInfo
WIALib::IWiaDispatchItem
WIALib::SafeWia
WIALib::Wia
WIALib::WiaProtocol
WIALib::WiaDeviceInfoPropertyId
WIALib::WiaFlag
WIALib::WiaIntent
WIALib::WiaItemPropertyId
Unfortunately I have no idea how to use these generated classes because
there appears to be no documentation other than for the original COM class
library and and that documentation only relates to unmanaged code that makes
use of pointers and interfaces.
My semi-random stab at getting it to take a picture is as follows.
Needless to say, this code does not work, so your help in correcting the
code or explaining how the classes work would be most appreciated.
using namespace WIALib;
WiaClass^ myWia = gcnew WiaClass();
int iCnt = myWia->Devices->Count;
Collection^ myDeviceInfo = myWia->Devices;
Collections::IEnumerator^ myEnumerator = myDeviceInfo->GetEnumerator();
myEnumerator->MoveNext();
IWiaDeviceInfo^ myDev = (IWiaDeviceInfo^)myEnumerator->Current;
Item^ myItem = myDev->Create();
if (myItem->ConnectStatus=="connected")
{
myItem->TakePicture();
myItem->Transfer("clipboard",false);
}
Regards,
Nicholas Lee