Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

issues with PROPVARIANT (in context of WIA), please help!!

62 views
Skip to first unread message

axis

unread,
Jun 10, 2003, 1:26:46 PM6/10/03
to
Background:
I am acquiring images using WIA, and wish to read the image's capture time
(so that when I copy the file to the machine, I can set
the file time to match the capture time on the camera). I can do this by
issuing a ReadMultiple command with a PROPSPEC
set to WIA_IPA_ITEM_TIME
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/stg/stg/ip
ropertystorage_readmultiple.asp).
This function places the result in a PROPVARIANT variable, supposedly in
SYSTEMTIME format.

Problem:
I don't know how to read the resulting PROPVARIANT variable (only in this
case, I have no issue when I ask for other properties of other
types using the same ReadMultiple command). In the doc
(http://msdn.microsoft.com/library/en-us/wia/wia/refwia/consts/wiaitempropco
mmonitem.asp), it is defined as

WIA_IPA_ITEM_TIME (PictureItemTime)
Time the image was captured.
Type: VT_UI2/VT_VECTOR, Access: Read Only
WIA devices report time in the SYSTEMTIME format.

When I try to read the variable, the VARTYPE vt field is set to 4114 (in
int, 0x1012 in hex), which doesn't seem to match any type defined
in PROPVARIANT! I've tried debugging and peeking at the contents of the
different variables in the union of PROPVARIANT and none
of the contents make sense.

If anyone out there can provide any guidance, I would be eternally
grateful!!!!!

Thanks.

P.S. - Please respond to the newsgroup and not the attached e-mail address,
as it is not real. I get too much spam as it is!


axis

unread,
Jun 10, 2003, 2:14:49 PM6/10/03
to
"axis" <no...@none.com> wrote in message
news:qxoFa.1195410$S_4.1214713@rwcrnsc53...

Well, desperation made me take one final look around google for any hints at
handling this, and I was able to figure it out! In case
anyone else ever has issues, here goes:

The vt = 0x1012 comes from OR'ing VT_VECTOR (0x1000) and something else (in
this case 0x0012, or 18 in int, which gives us VT_UI2).
So, in the resulting PROPVARIANT variable (lets call it pv) , we read
pv.caui.cElems to get the number of elements in the variable array, and then
pv.caui.pElems[*] has all the data, each item of type VT_UI2.

Thanks microsoft for making this so straightforward! :P

Cheers.


0 new messages