Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Memory usage for SetWindowText

Memory usage for SetWindowText

Scheduled Pinned Locked Moved C / C++ / MFC
helpperformance
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Coremn
    wrote on last edited by
    #1

    I have a simple program used for a video overlay where I use a CStatic object to display the time. I was looking at the memory usage for the program and discovered that it was increasing by 4k every 3-4 seconds:(. I found that the following code was the culprit, to be more specific, the SetWindowText line. (The code is called every second) CTime t1 = CTime::GetCurrentTime(); std::string time_str = (LPCTSTR)t1.Format("%H:%M:%S %d/%m/%y"); m_timeStatic.SetWindowText(time_str.c_str()); //memory increase I swapped over to use a CString object instead but the same problem was encountered. m_timeString = time_str.c_str(); UpdateData(FALSE); Please Help me!!!! Can anyone explain this!!!:confused::confused: ---

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups