I'm "porting" this code from BCB6 to BCB2010, and am getting the following error:
void myclass::VariantToSQL(Variant &v, String &dest)
datetime = (System::TDateTime)(v.AsType(varDate)); // Line 1830
// datetime = (TDateTime)v;
// These variations also don't work:
// datetime = v.AsType(varDate));
// datetime = (TDateTime)(v.AsType(varDate));
// datetime = (System::TDateTime)(v.AsType(varDouble));
[BCC32 Error] myclass.cpp(1830): E2015 Ambiguity between '_fastcall System::TDateTime::TDateTime(const System::TDateTime &) at c:\program files\embarcadero\rad studio\7.0\include\vcl\systdate.h:44' and '_fastcall System::TDateTime::TDateTime(const double) at c:\program files\embarcadero\rad studio\7.0\include\vcl\systdate.h:45'
Unlike the other posts I found regarding this sort of problem, I can't change the class to de-ambiguify the call. I'm a little mystified why the compiler can't tell that I'm passing it a TDateTime type.
I know just enough C++ to get by, and I didn't write this code. I bet one of you guys can spot the stupidity. Thanks so much for your help!