Monday, 15 June 2015

c++ - how to get values of the _variant_t? -



c++ - how to get values of the _variant_t? -

i want know how values of _variant_t type.

i know method value using getitems(), e.g.:

_variant_t var = prs->fields->getitem(i)->getvalue();

in excel file (.xls), can't find method whole info of row.

there collection of extractors can utilize extract info variant type. cast type variant represents. inner type, check 'vt' member.

here article @ msdn.

a sample code:

#include <windows.h> #include <comutil.h> #include <cassert> #pragma comment(lib, "comsuppw.lib") int main() { _variant_t v(10.0); assert(v.vt == vt_r8); // inner type double double value = static_cast<double>(v); // 10.0 homecoming 0; }

c++ excel variant

No comments:

Post a Comment