Menu

int number in a MessageBox??

ZickNesZ
2007-08-21
2012-09-26
  • ZickNesZ

    ZickNesZ - 2007-08-21

    How I use a int number in a MessageBox?

    I used

    MessageBox(hwnd, MAKEINTRESOURCE(ID_NUMBER), "Number", 0);

    but it didn't work...

    can anyone tell me how is? or there is another function?

     
    • ZickNesZ

      ZickNesZ - 2007-08-22

      Thanks!!!

       
    • Anonymous

      Anonymous - 2007-08-21

      TCHAR message[255] ;
      _stprintf( message, "%d", ID_NUMBER ) ;
      MessageBox(hwnd, message, "Number", 0) ;

      Note that this is portable between ANSI and Unicode through the use of TCHAR/_stprintf, if this is not necessary you could just use wchar_t/swprintf or char/sprintf.

      Clifford

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.