FreeThought wrote:Code: Select all
Import "oleaut32.lib"
VariantChangeTypeEx(vdst.p-variant ,vsrc.p-variant,lcid.l,cal.l,str$)
EndImport
if above is correct, how can I assign date() to vsrc.
Thanks.
OK, I'm just guessing here, a first guess:
From the MSDN, the actual function is:
VariantChangeTypeEx(VARIANTARG *pvargDest, VARIANTARG *pvarSrc, LCID lcid, unsigned short wFlags, VARTYPE vt )
(
http://msdn2.microsoft.com/en-us/library/ms221634.aspx)
where:
*pvargDest and *pvarSrc are pointers to something. So...to simplify it a little, it would look like this for PureBasic (I think)
VariantChangeTypeEx_(*pvargDest, *pvarSrc, lcid, wFlags, vt)
(need the _ to use API)
*pvarSrc can be VT_BSTR, VT_DISPATCH, or VT_DATE - so *pvarSrc points to one of those.
I think VT_DATE is a string = a date = VT_DATE.s
I think VT_BSTR is a string = a binary string = VT_BSTR .s
not sure what VT_DISPATCH is.
If they are strings:
VT_DATE.s = (the date)
VT_BSTR .s = (binary string)
using the date
pvarSrc.s = (the date)
pvargDest = (what ever is supposed to be here)
VariantChangeTypeEx_(@pvargDest, @pvarSrc, lcid, wFlags, vt)
@pvarSrc is pointing to the date now.
pvargDest [Out] Destination for the converted variant.
pvargSrc [Out] Source variant to change the type of.
lcid [In] LCID for the conversion.
wFlags [In] VARIANT_ flags from "oleauto.h".
vt [In] Variant type to change pvargSrc into.
Just a guess, i'm probably wrong. I'm sure someone will come along with a more suitable example for you.