Slippery Variant

  • Thread starter Scott McPhillips [MVP]
  • Start date
S

Scott McPhillips [MVP]

I am developing a Word COM Addin with C++ & ATL. From what I can tell
from the (barely relevant) VBA documentation the call below can return
three types of results: integer, enum or VT_DISPATCH to a Style object.

CComPtr <Paragraph> spParagraph;
CComVariant vtParaStyle = VT_EMPTY;

hr = spParagraphs->Item(para, &spParagraph);
ATLASSERT(SUCCEEDED(hr);
hr = spParagraph->get_Style(&vtParaStyle); // problem here

No matter how I initialize the vtParaStyle the returned type is always
VT_DISPATCH. Is there a way to get the other possible return types? I
need the enum form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top