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. Messagebox

Messagebox

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++
8 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.
  • A Offline
    A Offline
    Anonymous
    wrote on last edited by
    #1

    sorry for asking a very elementary question but i m new to VC++ Can there be a messagebox without any buttons?? green_trees

    A L R 3 Replies Last reply
    0
    • A Anonymous

      sorry for asking a very elementary question but i m new to VC++ Can there be a messagebox without any buttons?? green_trees

      A Offline
      A Offline
      A T I F
      wrote on last edited by
      #2

      I think not from MessageBox API...You can create your own dialog and control it via DoModal and EndDialog and have the appearance look of a MessageBox...

      1 Reply Last reply
      0
      • A Anonymous

        sorry for asking a very elementary question but i m new to VC++ Can there be a messagebox without any buttons?? green_trees

        L Offline
        L Offline
        Liger_Zero_X
        wrote on last edited by
        #3

        I think, there will Always be Button/s around it... You need to Fill In the Last Parameter...

        A 1 Reply Last reply
        0
        • L Liger_Zero_X

          I think, there will Always be Button/s around it... You need to Fill In the Last Parameter...

          A Offline
          A Offline
          Anonymous
          wrote on last edited by
          #4

          well, can u point the main difference between MessageBox and AfxMessageBox?

          J D 2 Replies Last reply
          0
          • A Anonymous

            well, can u point the main difference between MessageBox and AfxMessageBox?

            J Offline
            J Offline
            Jose Cezar S Ynion
            wrote on last edited by
            #5

            Anonymous wrote: well, can u point the main difference between MessageBox and AfxMessageBox? AfxMessageBox - a global function. MessageBox - a method available within a CWnd derived class You cannot call MessageBox within a non CWnd derived class. Ex: class A { public: void Display() { // error MessageBox(...); // should be AfxMessageBox(...) } }; But in this example class A { public: void Display() { MessageBox(...); // OK, juts like calling this->MessageBox(..) AfxMessageBox(...) // ok } };

            J 1 Reply Last reply
            0
            • J Jose Cezar S Ynion

              Anonymous wrote: well, can u point the main difference between MessageBox and AfxMessageBox? AfxMessageBox - a global function. MessageBox - a method available within a CWnd derived class You cannot call MessageBox within a non CWnd derived class. Ex: class A { public: void Display() { // error MessageBox(...); // should be AfxMessageBox(...) } }; But in this example class A { public: void Display() { MessageBox(...); // OK, juts like calling this->MessageBox(..) AfxMessageBox(...) // ok } };

              J Offline
              J Offline
              Jose Cezar S Ynion
              wrote on last edited by
              #6

              Jose Cezar S. Ynion wrote: But in this example class A { public: void Display() { MessageBox(...); // OK, juts like calling this->MessageBox(..) AfxMessageBox(...) // ok } Sorry for that this should be: class B:public CDialog { public: void Display() { MessageBox(...); // OK, just like calling this->MessageBox(..) AfxMessageBox(...) // ok }

              1 Reply Last reply
              0
              • A Anonymous

                sorry for asking a very elementary question but i m new to VC++ Can there be a messagebox without any buttons?? green_trees

                R Offline
                R Offline
                Ryan Binns
                wrote on last edited by
                #7

                Why would you want this? How would the user close the message box without buttons? If you are performing some background processing and will close the box yourself, then you don't want a message box. You want a modeless dialog box.

                Ryan

                "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

                1 Reply Last reply
                0
                • A Anonymous

                  well, can u point the main difference between MessageBox and AfxMessageBox?

                  D Offline
                  D Offline
                  David Crow
                  wrote on last edited by
                  #8

                  For starters, AfxMessageBox() is an MFC wrapper around the Win32 MessageBox() function. With MessageBox(), you supply the parent window, the caption, and the message text. With AfxMessageBox(), the parent window and the caption are handled automatically.


                  "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

                  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