CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: please help

  1. #1
    Join Date
    Jun 1999
    Posts
    123

    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.


  2. #2
    Join Date
    May 1999
    Location
    Texas, USA
    Posts
    568

    Re: please help

    You need to use the CTime::Format() function to get a string.


  3. #3
    Join Date
    May 1999
    Location
    Seattle, WA USA
    Posts
    423

    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
  •  





Click Here to Expand Forum to Full Width

Featured