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. create control of class CEdit

create control of class CEdit

Scheduled Pinned Locked Moved C / C++ / MFC
c++hardwarehelp
9 Posts 6 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.
  • D Offline
    D Offline
    durban2
    wrote on last edited by
    #1

    MFC, STUDIO 2008, MDI-project void CPage1::OnBnClickedButton1() { CRect rect(85, 110, 180, 210); CEdit m_edit; // Embedded edit object m_edit.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | WS_BORDER, rect, this, ID_EXTRA_EDIT); // error C2065: 'ID_EXTRA_EDIT' : undeclared identifier m_edit.SetFocus(); }

    I C C H 4 Replies Last reply
    0
    • D durban2

      MFC, STUDIO 2008, MDI-project void CPage1::OnBnClickedButton1() { CRect rect(85, 110, 180, 210); CEdit m_edit; // Embedded edit object m_edit.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | WS_BORDER, rect, this, ID_EXTRA_EDIT); // error C2065: 'ID_EXTRA_EDIT' : undeclared identifier m_edit.SetFocus(); }

      I Offline
      I Offline
      Iain Clarke Warrior Programmer
      wrote on last edited by
      #2

      1/ What's your question 2/ Include resource.h? Your compiler is saying "ID_EXTRA_EDIT? Never heard of it" 3/ Check your spelling. Iain.

      In the process of moving to Sweden for love (awwww). If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job! http://cv.imcsoft.co.uk/[^]

      1 Reply Last reply
      0
      • D durban2

        MFC, STUDIO 2008, MDI-project void CPage1::OnBnClickedButton1() { CRect rect(85, 110, 180, 210); CEdit m_edit; // Embedded edit object m_edit.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | WS_BORDER, rect, this, ID_EXTRA_EDIT); // error C2065: 'ID_EXTRA_EDIT' : undeclared identifier m_edit.SetFocus(); }

        C Offline
        C Offline
        Cedric Moonen
        wrote on last edited by
        #3

        Yes, and ? Just define ID_EXTRA_EDIT in your resource.h file.

        Cédric Moonen Software developer
        Charting control [v2.0 - Updated] OpenGL game tutorial in C++

        1 Reply Last reply
        0
        • D durban2

          MFC, STUDIO 2008, MDI-project void CPage1::OnBnClickedButton1() { CRect rect(85, 110, 180, 210); CEdit m_edit; // Embedded edit object m_edit.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | WS_BORDER, rect, this, ID_EXTRA_EDIT); // error C2065: 'ID_EXTRA_EDIT' : undeclared identifier m_edit.SetFocus(); }

          C Offline
          C Offline
          China_Kevin
          wrote on last edited by
          #4

          First I am a Chinese boy. My English is not very good. change m_edit.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | WS_BORDER, rect, this, ID_EXTRA_EDIT); // error C2065: 'ID_EXTRA_EDIT' : undeclared identifier for m_edit.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | WS_BORDER, rect, this, 1234); // error C2065: 'ID_EXTRA_EDIT' : undeclared identifier the meaning is Specifies the edit control’s ID.(msdn) then you will change m_edit as a class member,because, when the OnBnClickedButton1 is finished m_edit is lost. sorry,my English is so poor...

          C 1 Reply Last reply
          0
          • C China_Kevin

            First I am a Chinese boy. My English is not very good. change m_edit.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | WS_BORDER, rect, this, ID_EXTRA_EDIT); // error C2065: 'ID_EXTRA_EDIT' : undeclared identifier for m_edit.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | WS_BORDER, rect, this, 1234); // error C2065: 'ID_EXTRA_EDIT' : undeclared identifier the meaning is Specifies the edit control’s ID.(msdn) then you will change m_edit as a class member,because, when the OnBnClickedButton1 is finished m_edit is lost. sorry,my English is so poor...

            C Offline
            C Offline
            Cedric Moonen
            wrote on last edited by
            #5

            blueapplezh wrote:

            then you will change m_edit as a class member,because, when the OnBnClickedButton1 is finished m_edit is lost.

            Yes, that's correct, I didn't see that at all.

            blueapplezh wrote:

            change m_edit.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | WS_BORDER, rect, this, ID_EXTRA_EDIT); // error C2065: 'ID_EXTRA_EDIT' : undeclared identifier for m_edit.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | WS_BORDER, rect, this, 1234); // error C2065: 'ID_EXTRA_EDIT' : undeclared identifier the meaning is Specifies the edit control’s ID.(msdn)

            I wouldn't advise that. The reason is that it is much safer to add a new Id in the resource.h file and use it. This way you have a central place where you define all your ID's and you can make sure you won't reuse the same Id twice.

            Cédric Moonen Software developer
            Charting control [v2.0 - Updated] OpenGL game tutorial in C++

            C 1 Reply Last reply
            0
            • C Cedric Moonen

              blueapplezh wrote:

              then you will change m_edit as a class member,because, when the OnBnClickedButton1 is finished m_edit is lost.

              Yes, that's correct, I didn't see that at all.

              blueapplezh wrote:

              change m_edit.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | WS_BORDER, rect, this, ID_EXTRA_EDIT); // error C2065: 'ID_EXTRA_EDIT' : undeclared identifier for m_edit.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | WS_BORDER, rect, this, 1234); // error C2065: 'ID_EXTRA_EDIT' : undeclared identifier the meaning is Specifies the edit control’s ID.(msdn)

              I wouldn't advise that. The reason is that it is much safer to add a new Id in the resource.h file and use it. This way you have a central place where you define all your ID's and you can make sure you won't reuse the same Id twice.

              Cédric Moonen Software developer
              Charting control [v2.0 - Updated] OpenGL game tutorial in C++

              C Offline
              C Offline
              China_Kevin
              wrote on last edited by
              #6

              I wouldn't advise that. The reason is that it is much safer to add a new Id in the resource.h file and use it. This way you have a central place where you define all your ID's and you can make sure you won't reuse the same Id twice. You are clever,I have advise that,but my English is too poor to express my opinion. If I am a USA boy ,HOHO~~~~~

              C 1 Reply Last reply
              0
              • C China_Kevin

                I wouldn't advise that. The reason is that it is much safer to add a new Id in the resource.h file and use it. This way you have a central place where you define all your ID's and you can make sure you won't reuse the same Id twice. You are clever,I have advise that,but my English is too poor to express my opinion. If I am a USA boy ,HOHO~~~~~

                C Offline
                C Offline
                CPallini
                wrote on last edited by
                #7

                blueapplezh wrote:

                You are clever,I have advise that,but my English is too poor to express my opinion.

                I would advise you to use the 'Quote Selected Text' button to report the words of the post you're replying to. :rolleyes: :)

                If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                [My articles]

                C 1 Reply Last reply
                0
                • D durban2

                  MFC, STUDIO 2008, MDI-project void CPage1::OnBnClickedButton1() { CRect rect(85, 110, 180, 210); CEdit m_edit; // Embedded edit object m_edit.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | WS_BORDER, rect, this, ID_EXTRA_EDIT); // error C2065: 'ID_EXTRA_EDIT' : undeclared identifier m_edit.SetFocus(); }

                  H Offline
                  H Offline
                  Hamid Taebi
                  wrote on last edited by
                  #8

                  #define ID_EXTRA_EDIT 3000 is your answer and also I saw one more thing in your code you must declare CEdit m_edit out of this function.

                  Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )

                  1 Reply Last reply
                  0
                  • C CPallini

                    blueapplezh wrote:

                    You are clever,I have advise that,but my English is too poor to express my opinion.

                    I would advise you to use the 'Quote Selected Text' button to report the words of the post you're replying to. :rolleyes: :)

                    If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                    This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                    [My articles]

                    C Offline
                    C Offline
                    China_Kevin
                    wrote on last edited by
                    #9

                    CPallini wrote:

                    I would advise you to use the 'Quote Selected Text' button to report the words of the post you're replying to. Roll eyes Smile

                    Thanks very mu :-D ch!!!

                    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