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. getdlgitem/getwindowtext

getdlgitem/getwindowtext

Scheduled Pinned Locked Moved C / C++ / MFC
helpannouncement
5 Posts 3 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.
  • R Offline
    R Offline
    raysuman
    wrote on last edited by
    #1

    I have to get back the static text on a dialog programatically. Say version number on help about dialog which will keep on changing . But when the code like getwindow text executes the dialog is not active . So grtting invalid handle .please advise Suman ray

    M 1 Reply Last reply
    0
    • R raysuman

      I have to get back the static text on a dialog programatically. Say version number on help about dialog which will keep on changing . But when the code like getwindow text executes the dialog is not active . So grtting invalid handle .please advise Suman ray

      M Offline
      M Offline
      mcsherry
      wrote on last edited by
      #2

      assuming you have an object in your main program for this dialog and you are also using MFC, then you can assign a variable (CString probably) to the text box using the class wizard and then you should be able to access it in your main program (you may need to add a Get method). hth

      R 1 Reply Last reply
      0
      • M mcsherry

        assuming you have an object in your main program for this dialog and you are also using MFC, then you can assign a variable (CString probably) to the text box using the class wizard and then you should be able to access it in your main program (you may need to add a Get method). hth

        R Offline
        R Offline
        raysuman
        wrote on last edited by
        #3

        the problem is that there is no gurantee that this object will be created in program lifetime. In fact if the user does not click on help->about , object is never created. Suman ray

        M H 2 Replies Last reply
        0
        • R raysuman

          the problem is that there is no gurantee that this object will be created in program lifetime. In fact if the user does not click on help->about , object is never created. Suman ray

          M Offline
          M Offline
          mcsherry
          wrote on last edited by
          #4

          Couldn't you create the object in your constructor and then override the help->about method so that it just does "m_HelpDialog.DoModal ( ) ;" ? This way the object will always exist during the program run. Andy,

          1 Reply Last reply
          0
          • R raysuman

            the problem is that there is no gurantee that this object will be created in program lifetime. In fact if the user does not click on help->about , object is never created. Suman ray

            H Offline
            H Offline
            HENDRIK R
            wrote on last edited by
            #5

            raysuman wrote: the problem is that there is no gurantee that this object will be created in program lifetime perhaps calling IsWindow(..) with the handle of the static control to receive the text from before doing so helps


            We are men. We are different. We have only one word for soap. We do not own candles. We have never seen anything of any value in a craft shop. We do not own magazines full of photographs of celebrities with their clothes on. - Steve

            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