• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1043
  • Last Modified:

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[] =
            VTS_VARIANT;
      InvokeHelper(0x2b, DISPATCH_METHOD, VT_EMPTY, NULL, parms,
             &vDialog);
}

In VB, the way to send a mail is:

mapMess.Compose
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.

m_mapMess.Compose();
m_mapMess.Send(???);

Thanks
0
Malek103197
Asked:
Malek103197
  • 2
  • 2
1 Solution
 
mikeblasCommented:
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

m_mapMess.Compose();
m_mapMess.Send(myVariant);

..B ekiM

0
 
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.
0
 
mikeblasCommented:
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
0
 
Malek103197Author Commented:
Thanks for the info.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now