Beside the solutions already posted here, the most handy way to deal with VARIANT structures in MFC is to use COleVariant.
Just:
A little bit easier, isn't it?Code:COleDateTime mytime(1996, 1, 1, 0, 0, 0); function(COleVariant(mytime)); // COleVariant has a constructor which takes const COleDateTime& and an operator LPVARIANT().




Reply With Quote
