|
-
September 7th, 1999, 04:21 PM
#1
please help
Does anyone know why this doesn't work?
{
CTime theTime;
theTime=CTime::GetCurrentTime();
m_time=theTime;
}
m_time is a variable from an edit box in my dialog. I am having trouble getting it to set theTime equal to m_time. Please help, the error message is listed below. (I have tried making m_time a CString or an int, but nothing seems to work.)
error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'class CTime' (or there is no acceptable conversion)
Thanks for everything.
-
September 7th, 1999, 04:36 PM
#2
Re: please help
You need to use the CTime::Format() function to get a string.
-
September 7th, 1999, 04:37 PM
#3
Re: please help
It doesn't work because nobody has define an = operator that takes a CTime & puts it into a CString (or anything else).
if m_time is a CString, then use CTime::Format, if m_time is an int, then you can use CTime::GetTime, or CTime::GetYear, CTime::GetDay, etc.
HTH
--michael
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|