Convert variant to object (VB-COM used in VC)
>Set MyObj = MyEtmObj.GetObject("ObjName")
>in VC the function has the automatically generated Header:
>VARIANT GetObject(BSTR* modname);
>How can I convert a variant to an object? Is there a way like
>variantVariable.intVal for integers?
A VARIANT is a union of several possible types (see "VARIANT and
VARIANTARG" in the Platform SDK docs).
There are functions (such as VariantChangeType) to convert a VARIANT
to different forms, but in your situation, I guess your VARIANT will
be an IDispatch pointer (the vt member == VT_DISPATCH - the pdispVal
value of the VARIANT).
MVP VC++ FAQ: http://www.mvps.org/vcfaq
My address is altered to discourage junk mail.
Please post responses to the newsgroup thread,
there's no need for follow-up email copies.