tags:

views:

54

answers:

1

How can I convert a "YYYY/MM/DD" formatted date to a VARIANT type date and vice-versa in C++?

EDIT

VARIANT VT_DATE Type passed by VBA code into an automation COM written in c++

A: 

Did you try via CComVariant ?

E.g. : (from string to date)

VARIANT myVBDate;
CComVariant myDate("YYYY/MM/DD date");
if (SUCCEEDED(myDate.ChangeType(VT_DATE)) && SUCCEEDED(myDate.Detach(&myVBDate)))
{
    // do something with myVBDate
}
da_m_n