I have a CDateTime
class with the following method:
CDateTime& operator=(const COleDateTime& datetime)
{
SetDateTime(&datetime);
return *this;
}
But it doesn't appear to be working.
Can someone tell me what I missed?
You are initializing, not assigning, dtStart
and dtEnd
variables. To make the initialization work, you need this constructor: CDateTime(const COleDateTime& datetime)
.
Or, if CDateTime
has default constructor, you can split the initialization into declaration and assignment:
CDateTime dtStart; dtStart = dlg.m_dtStartDate;