This is probably a question for The Trick, but I'm certainly willing to read ideas from anyone.
Okay, what am I talking about? I'm talking about using the VariantChangeTypeEx call, and specifying any of
VT_UI2,
VT_UI4,
VT_UI8, or
VT_I1. If you do this, and then subsequently do any math with the numbers, you'll get this
Automation Type Unsupported error.
I'm not entirely clear on whether this math is getting done in oleaut32.dll or possibly somewhere else. However, it's clear that it can be done. It just seems that VB6 is leary about doing it. I'm just wondering if there's some way to suppress the error, and have VB6 go ahead and do it. Trick, I mention your name because you've already done something similar with your
Advanced Tools, and you also have incredible knowledge about some of the darkest corners of VB6.
Also, just to mention it, the LongLong type (VT_I8) works fine so long as it's ByVal in the Variant. If it's ByRef in the Variant, it also throws this Automation Type Unsupported error.
Also, here's a cross-reference between VB6, VBA, PROPVARIANT, and .NET:
Code:
VB6 VBA PropVar .NET
Byte Byte VT_UI1 Byte
n/a n/a VT_UI2 UShort
n/a n/a VT_UI4 UInteger
n/a n/a VT_UI8 ULong
n/a n/a VT_I1 SByte
Integer Integer VT_I2 Short
Long Long VT_I4 Integer
in Variant LongLong VT_I8 Long
And, when in a Variant, they can be either
ByVal (in the Variant) or ByRef (Variant points to).
It'd just be nice if we (VB6 coders) could have access to all of these types, with full in-line math support.
Thanks,
Elroy