Windows Image Acquisition Library in BCB6


2005-07-07 10:35:05 AM
cppbuilder46
Hi
I've imported the type library Windows Image Acuisition Library v2.0
(wiaaut.dll) and created the various classes.
If I call the ShowPhotoPrintingWizard method of TWIACommonDialog (I
inserted WIA in the class names in case of conflicts with other classes I
had so it is just TCommonDialog), with just a string paramter the wizard
shows and prints the photo fine.
If I create a TWIAVector class (=TVector) and add the string to that class,
and then call the ShowPhotoPrintingWizard with the vector as the parameter
nothing happens - no error or anything.
Code below does nothing -->
wchar_t *file=L"c:\\testprint.jpg";
TVariant v,f;
f=TVariant(file);
WIAVector1->Add(f,0);
v=TVariant(WIAVector1);
WIACommonDialog1->ShowPhotoPrintingWizard(v);
But following will work -->
WIACommonDialog1->ShowPhotoPrintingWizatd(TVariant(file));
From what I can see the variant created with WIAVector1 as the paramater is
of type VT_BOOL ??? I tried setting v.vt=VT_DISPATCH but that just created
an access violation.
Any idea how to correctly populate the vector class and pass it to the
PrintingWizard ?
Thanks
Jody