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. About AfxMessageBox

About AfxMessageBox

Scheduled Pinned Locked Moved C / C++ / MFC
help
10 Posts 7 Posters 2 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
    rs2006
    wrote on last edited by
    #1

    VS2005: CString m_strMessageBox; ............. void CHelloDialogDlg::OnBnClickedOk() { UpdateData(TRUE); AfxMessageBox(m_strMessageText); } No any error,But when I click the button,the MessageBox cannot show the string m_strMessageText. Thank you for help!

    G P Z 3 Replies Last reply
    0
    • R rs2006

      VS2005: CString m_strMessageBox; ............. void CHelloDialogDlg::OnBnClickedOk() { UpdateData(TRUE); AfxMessageBox(m_strMessageText); } No any error,But when I click the button,the MessageBox cannot show the string m_strMessageText. Thank you for help!

      G Offline
      G Offline
      ghunzel06
      wrote on last edited by
      #2

      well i didn't see any value of the m_strMessageText in the code.

      R 1 Reply Last reply
      0
      • G ghunzel06

        well i didn't see any value of the m_strMessageText in the code.

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

        well,It's the variable of a Edit Control,and i input a string into the control

        C 1 Reply Last reply
        0
        • R rs2006

          well,It's the variable of a Edit Control,and i input a string into the control

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

          Does UpdateData() return TRUE? Have you set a breakpoint in your DoDataExchange() function to check that the string is being set from the edit control? Have you set a breakpoint before the message box is called to see what the value of the string is? You should try some basic debugging - it's the best teacher:)

          Peter "Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."

          B 1 Reply Last reply
          0
          • R rs2006

            VS2005: CString m_strMessageBox; ............. void CHelloDialogDlg::OnBnClickedOk() { UpdateData(TRUE); AfxMessageBox(m_strMessageText); } No any error,But when I click the button,the MessageBox cannot show the string m_strMessageText. Thank you for help!

            P Offline
            P Offline
            Paresh Chitte
            wrote on last edited by
            #5

            Have you entered in the message in message map BEGIN_MESSAGE_MAP END_MESSAGE_MAP Regards, Paresh.

            1 Reply Last reply
            0
            • R rs2006

              VS2005: CString m_strMessageBox; ............. void CHelloDialogDlg::OnBnClickedOk() { UpdateData(TRUE); AfxMessageBox(m_strMessageText); } No any error,But when I click the button,the MessageBox cannot show the string m_strMessageText. Thank you for help!

              Z Offline
              Z Offline
              zon_cpp
              wrote on last edited by
              #6

              call UpdateData(FALSE) instead UpdateData(TRUE) void CHelloDialogDlg::OnBnClickedOk() { UpdateData(FALSE); AfxMessageBox(m_strMessageText); } -- modified at 1:35 Thursday 29th March, 2007

              Zo.Naderi-Iran

              P 1 Reply Last reply
              0
              • Z zon_cpp

                call UpdateData(FALSE) instead UpdateData(TRUE) void CHelloDialogDlg::OnBnClickedOk() { UpdateData(FALSE); AfxMessageBox(m_strMessageText); } -- modified at 1:35 Thursday 29th March, 2007

                Zo.Naderi-Iran

                P Offline
                P Offline
                Parthi_Appu
                wrote on last edited by
                #7

                zon_cpp wrote:

                call UpdateData(FALSE) instead UpdateData(TRUE)

                To retrieve data from the control we have to pass TRUE, so UpdateData(TRUE) is correct.


                Do your Duty and Don't expect the Result
                Rate this Post, if I helped You

                Z 1 Reply Last reply
                0
                • P Parthi_Appu

                  zon_cpp wrote:

                  call UpdateData(FALSE) instead UpdateData(TRUE)

                  To retrieve data from the control we have to pass TRUE, so UpdateData(TRUE) is correct.


                  Do your Duty and Don't expect the Result
                  Rate this Post, if I helped You

                  Z Offline
                  Z Offline
                  zon_cpp
                  wrote on last edited by
                  #8

                  Yes, i mistook.:wtf: :sigh: excuse me

                  Zo.Naderi-Iran

                  P 1 Reply Last reply
                  0
                  • C cp9876

                    Does UpdateData() return TRUE? Have you set a breakpoint in your DoDataExchange() function to check that the string is being set from the edit control? Have you set a breakpoint before the message box is called to see what the value of the string is? You should try some basic debugging - it's the best teacher:)

                    Peter "Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."

                    B Offline
                    B Offline
                    bios8086
                    wrote on last edited by
                    #9

                    "You should try some basic debugging - it's the best teacher" that's right!!!!;)

                    1 Reply Last reply
                    0
                    • Z zon_cpp

                      Yes, i mistook.:wtf: :sigh: excuse me

                      Zo.Naderi-Iran

                      P Offline
                      P Offline
                      Parthi_Appu
                      wrote on last edited by
                      #10

                      No prob, every body do mistake :).


                      Do your Duty and Don't expect the Result
                      Rate this Post, if I helped You

                      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