MessageBox - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

MessageBox

RX7RX7 Posts: 9Member
Is there an easy way of display a number, in the place of the text, in a [b]MessageBox[/b]. The text is expected to be a null-terminated string, so I can't just cast right?

I bet there is an esay answer to this...

Comments

  • AsmGuru62AsmGuru62 Posts: 6,519Member
    : Is there an easy way of display a number, in the place of the text, in a [b]MessageBox[/b]. The text is expected to be a null-terminated string, so I can't just cast right?
    :
    : I bet there is an esay answer to this...
    :

    #include
    #include


    ... WinMain here...
    {
    int nValue = 1234;
    char strReport [128];

    sprintf (strReport , "My value now is: %d", nValue);
    MessageBox (0, strReport, "Whoa!", MB_ICONEXCLAMATION);

    ...
    }



  • ChemanuelChemanuel Posts: 9Member
    : Is there an easy way of display a number, in the place of the text, in a [b]MessageBox[/b]. The text is expected to be a null-terminated string, so I can't just cast right?
    :
    : I bet there is an esay answer to this...
    :

    #include

    int main
    {

    char lpT[30];

    wsprintf(lpT, "I wish I had %i million bucks", 1);

    MessageBox(hWnd, lpT, "Yeap", MB_OK);

    }

    Chemanuel

    [italic][blue]El rincn de Chemanuel[/blue][/italic]
    [blue]http://www.geocities.com/josempadron[/blue]


  • RX7RX7 Posts: 9Member
    Thanks!


Sign In or Register to comment.