VTS_VARIANT/VARIANT and ActiveX controls

I am using the CMapiMessges ActiveX control and stuck when it comes to using functions that require the passing of a VARIANT. For example, the following function:

void CMapiMessages::Send(const VARIANT& vDialog)
      static BYTE parms[] =
      InvokeHelper(0x2b, DISPATCH_METHOD, VT_EMPTY, NULL, parms,

In VB, the way to send a mail is:

mapMess.Send True 'this statement actually launches the Send Mail Dialog.

In VC++, using the CMapiMessges control, it is the following, except I'm stuck on what to put in the Send() function.


Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You just need to have a VARIANT that evaluates to TRUE or FALSE.

VARIANT myVariant;
V_VT(&myVariant) = VT_BOOL;
V_BOOL(&myVariant) = VARIANT_TRUE;
// or, use VARIANT_FALSE


..B ekiM


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Malek103197Author Commented:
Thanks for your solution. I foresee myself using more and more ActiveX controls and therefore, must build a better understanding of the use of the VARIANT. Can you suggest a resource for learning more on this? Thanks again.
The documentation I've been able to find on it is really weak. I'm writing an article about it, and it'll probably be published soon.

"Inside OLE" (Kraig Brockschmidt's book) and various scattered articles in MSDN have advice about 'em. But not much more than that.

..B ekiM
Malek103197Author Commented:
Thanks for the info.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.