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. Changing the title in SDI app

Changing the title in SDI app

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++comperformance
3 Posts 2 Posters 1 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.
  • P Offline
    P Offline
    pmarki
    wrote on last edited by
    #1

    How can I change the title of a sdi application? I used CDocument->SetTitle() - doesn't work (nothing changes) used CMainFrame->SetWindowText - but this crashes my app (Unhandled exception - memory violation - as It got a NULL pointer, when i debugged, inside the MFC function SetWindowText, there was an ASSERT(::IsWindow(m_hWnd)), but this(==m_hWnd) was equal to NULL, so that is why there was memory violation ... used m_pszAppName (changed it) and nothing changes ... heard about taking care of OnUpdateFrameTitle, but this method is not a member of frame, or document, but an ole class ... used many other strange ways, and did not succeed ...:mad: Anyone having an idea ?PLZ:rolleyes:

    M 1 Reply Last reply
    0
    • P pmarki

      How can I change the title of a sdi application? I used CDocument->SetTitle() - doesn't work (nothing changes) used CMainFrame->SetWindowText - but this crashes my app (Unhandled exception - memory violation - as It got a NULL pointer, when i debugged, inside the MFC function SetWindowText, there was an ASSERT(::IsWindow(m_hWnd)), but this(==m_hWnd) was equal to NULL, so that is why there was memory violation ... used m_pszAppName (changed it) and nothing changes ... heard about taking care of OnUpdateFrameTitle, but this method is not a member of frame, or document, but an ole class ... used many other strange ways, and did not succeed ...:mad: Anyone having an idea ?PLZ:rolleyes:

      M Offline
      M Offline
      Michael P Butler
      wrote on last edited by
      #2

      Where abouts in your code were you changing the window title via the CMainFrame::SetWindowText. It sounds like you were trying to do it before the window was created. Michael :-)

      P 1 Reply Last reply
      0
      • M Michael P Butler

        Where abouts in your code were you changing the window title via the CMainFrame::SetWindowText. It sounds like you were trying to do it before the window was created. Michael :-)

        P Offline
        P Offline
        pmarki
        wrote on last edited by
        #3

        Inside the CDocument constructor, I wanted to change the title bar, when the document changes in some way... and I call a function (which calls CMainFrame::SetWindowText() ) from CDocument's constructor, and if this constructor is called when the frame doesn't exist, that is the answer... hey, thank you, I hope that is the case :)

        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