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 used in C++ .NET

MessageBox used in C++ .NET

Scheduled Pinned Locked Moved C / C++ / MFC
helpcsharpc++comtutorial
4 Posts 2 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.
  • T Offline
    T Offline
    Tom Sapp
    wrote on last edited by
    #1

    I am trying to use MessageBox in .NET but I keep getting an error. Code I am using: MessageBox( NULL, "This is the text", "MessageBox", MB_OK ); Error I am recieving: error C2065: 'MB_OK' : undeclared identifier I get this error, however, when I mouse over MB_OK it gives me a tooltip saying "#define MB_OK 0x00000000L". Anyone know what I can use in it's place or how to fix this? Thanks, Tom Sapp http://www.sappsworld.com

    C 1 Reply Last reply
    0
    • T Tom Sapp

      I am trying to use MessageBox in .NET but I keep getting an error. Code I am using: MessageBox( NULL, "This is the text", "MessageBox", MB_OK ); Error I am recieving: error C2065: 'MB_OK' : undeclared identifier I get this error, however, when I mouse over MB_OK it gives me a tooltip saying "#define MB_OK 0x00000000L". Anyone know what I can use in it's place or how to fix this? Thanks, Tom Sapp http://www.sappsworld.com

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      I just use 0. Christian Graus - Microsoft MVP - C++

      T 1 Reply Last reply
      0
      • C Christian Graus

        I just use 0. Christian Graus - Microsoft MVP - C++

        T Offline
        T Offline
        Tom Sapp
        wrote on last edited by
        #3

        Well, that resolved that issue. Now I have this issue: error C2514: 'System::Windows::Forms::MessageBox' : class has no constructors Guess I am not doing something right! Thanks, Tom Sapp http://www.sappsworld.com

        C 1 Reply Last reply
        0
        • T Tom Sapp

          Well, that resolved that issue. Now I have this issue: error C2514: 'System::Windows::Forms::MessageBox' : class has no constructors Guess I am not doing something right! Thanks, Tom Sapp http://www.sappsworld.com

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          Oh, this is a managed C++ message box. In that case - MessageBox has no constructors. Instead, it has a static method called Show. In that case, you need to pass in the managed enum, you can't pass in a MB value or a number. Christian Graus - Microsoft MVP - C++

          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