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. displaying an variable value into AfxMessageBox

displaying an variable value into AfxMessageBox

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

    Hellp i want to display data from an interger variable into an AfxMessageBox i have no compilation errors but when i run the App i have a diaglog Box with 3 buttons ' Ignore ' ' Continue' ... What's the problem ! UpdateData(true); AfxMessageBox(m_terma); CDialog::OnOK(); Thank you very much for your help!

    RaviBeeR R H T 4 Replies Last reply
    0
    • M Mahhouraaaaaa

      Hellp i want to display data from an interger variable into an AfxMessageBox i have no compilation errors but when i run the App i have a diaglog Box with 3 buttons ' Ignore ' ' Continue' ... What's the problem ! UpdateData(true); AfxMessageBox(m_terma); CDialog::OnOK(); Thank you very much for your help!

      RaviBeeR Offline
      RaviBeeR Offline
      RaviBee
      wrote on last edited by
      #2

      CString strMessage;
      strMessage.Format ("var = %d", m_terma);
      AfxMessageBox (strMessage);

      You're probably better off using the TRACE() macro. /ravi My new year's resolution: 2048 x 1536 Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

      1 Reply Last reply
      0
      • M Mahhouraaaaaa

        Hellp i want to display data from an interger variable into an AfxMessageBox i have no compilation errors but when i run the App i have a diaglog Box with 3 buttons ' Ignore ' ' Continue' ... What's the problem ! UpdateData(true); AfxMessageBox(m_terma); CDialog::OnOK(); Thank you very much for your help!

        R Offline
        R Offline
        Renjith Ramachandran
        wrote on last edited by
        #3

        Mahhouraaaaaa wrote:

        UpdateData(true); AfxMessageBox(m_terma); CDialog::OnOK();

        i think m_terma is of type integer. so this CString csMsg; csMsg.Format("%d", m_terma); AfxMessageBox(csMsg); try it out Loka Samastha Sukhino Bhavanthu..!!! ( May all beings be happy and free )

        1 Reply Last reply
        0
        • M Mahhouraaaaaa

          Hellp i want to display data from an interger variable into an AfxMessageBox i have no compilation errors but when i run the App i have a diaglog Box with 3 buttons ' Ignore ' ' Continue' ... What's the problem ! UpdateData(true); AfxMessageBox(m_terma); CDialog::OnOK(); Thank you very much for your help!

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

          CString str; int m_terma=20; str.Format ("Value = %i", m_terma); AfxMessageBox (str); ------------------------------------ TCHAR buffer[50]; itoa(m_terma,buffer,10); AfxMessageBox (buffer); ------------------------------------ TCHAR buffer2[50]; wsprintf(buffer2,"Value = %i",m_terma); AfxMessageBox (buffer2);_**


          **_

          whitesky


          1 Reply Last reply
          0
          • M Mahhouraaaaaa

            Hellp i want to display data from an interger variable into an AfxMessageBox i have no compilation errors but when i run the App i have a diaglog Box with 3 buttons ' Ignore ' ' Continue' ... What's the problem ! UpdateData(true); AfxMessageBox(m_terma); CDialog::OnOK(); Thank you very much for your help!

            T Offline
            T Offline
            ThatsAlok
            wrote on last edited by
            #5

            Mahhouraaaaaa wrote:

            Hellp i want to display data from an interger variable into an AfxMessageBoxi have no compilation errors but when i run the App i have a diaglog Box with 3 buttons ' Ignore ' ' Continue' ...What's the problem !

            What about setting the breakpoint after UpdateData, and seeing the value in the Quick Watch Window!

            "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

            cheers, Alok Gupta VC Forum Q&A :- I/ IV

            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