I'm using a COleDateTime object to set the value of the variant
that is passed to the
I've been able to successfully set string
parameters in the report with an almost identical
function, so it seems to be a problem with how I'm handling the date.
As I step through the program in the Debugger, I can see that the
variant has the correct date stored in it, but
I get an unhandled exception at the the
.
_Any_suggestions?
that is passed to the
Code:
AddCurrentValue()
I've been able to successfully set string
parameters in the report with an almost identical
function, so it seems to be a problem with how I'm handling the date.
As I step through the program in the Debugger, I can see that the
variant has the correct date stored in it, but
I get an unhandled exception at the the
Code:
AddCurrentValue()
_Any_suggestions?
Code:
void CDlgReportView::SetReportDateParameter(long index, CTime Date){
_variant_t vtDate;
COleDateTime oleDate(Date.GetTime());
VariantInit (&vtDate);
vtDate.ChangeType(VT_DATE);
vtDate.date=DATE(oleDate);
m_Report->ParameterFields->GetItem(index)->ClearCurrentValueAndRange();
m_Report->ParameterFields->GetItem(index)->AddCurrentValue(vtDate);
}