One question for WINCE variable

Hi that's my sample code could some one tell me that, how to put variable into MessageBox

[code]

#include "windows.h"
#include "string.h"
//
// Program entry point
//


int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
                    LPWSTR lpCmdLine, int nCmdShow) {


   char ch[50] = "hello world !";

    MessageBox (NULL, TEXT (ch), TEXT ("Hello2"), MB_OK);
    // some error message on here

    return 0;
}

[/code]




Answer this question

One question for WINCE variable

  • cnminor

     it's quite simple to explain what i want to do ,  i want to put on
     char i[50] = "hello world !";
     into TEXT () in this part . 
     MessageBox (NULL, TEXT (), TEXT ("Hello2"), MB_OK);
      become
     MessageBox (NULL, TEXT (i), TEXT ("Hello2"), MB_OK);

    but when i did that way , the error message indicate that

    error C2065: 'Li' : undeclared identifier
    Error executing cl.exe.



  • Wolffighters

    TEXT is a macro. this macro cannot be used for varaiables its only allowed to use it with string constants.

  • under_way

    Looks like you just did, if ch is the variable you're referring to.  If you're referring to WINCE, can you clarify what this is and exactly what you want to do with it   If it's an integer value, you can convert it to a string by using itoa().

    BTW, you should use #include <windows.h> and #include <string.h> since these headers are to be picked up strictly from the include path (and not in your local directory).  (It's conventional.)


  • Vasil B

    ok and other question for Command prompt ....
    in my standardsdk_420 emulator where can i find Command prompt if some one know it can you please tell it thanks



  • laweber3

    Windows CE questions really belong in the Smart Devices Native C++ Development forum. 
  • One question for WINCE variable