help with strings
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: help with strings

  1. #1
    Join Date
    Oct 2012
    Posts
    18

    help with strings

    how would i do a string with this cos its a multiple option thingy lol
    typedef CONST WCHAR *LPCWSTR, *PCWSTR;

  2. #2
    Join Date
    Oct 2012
    Posts
    18

    Re: help with strings

    can anybody help i mean i usually just put L"what ever text" but it gives me this error with this Error: argument of type "const wchar_t*" is incompatible with parameter of type "LPCWSTR *"

  3. #3
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: help with strings

    What are you trying to do... because the reason nobody responds is that we haven't got a clue what you are talking about.

  4. #4
    Join Date
    Oct 2012
    Posts
    18

    Re: help with strings

    Quote Originally Posted by Skizmo View Post
    What are you trying to do... because the reason nobody responds is that we haven't got a clue what you are talking about.
    ok so i have this
    DWORD XShowMessageBoxUI(DWORD dwUserIndex,LPCWSTR wszTitle,LPCWSTR wszText,DWORD cButtons,LPCWSTR *pwszButtons,DWORD dwFocusButton,DWORD dwFlags,MESSAGEBOX_RESULT *pResult,XOVERLAPPED *pOverlapped)

    z = XShowMessageBoxUI (XUSER_INDEX_ANY,L"Stelth V1",L"Thanks For Chossing Stelth V1. Stelth V1 Is Now Fully Loaded. HAVE FUN!!!",1,L"Play Modz",1,XMB_ALERTICON,NULL,NULL);

    ok so then on it all works fine untill it gets to the L"Play Modz" for the LPCWSTR *pwszButtons and then it gives me thist error

    Error: argument of type "const wchar_t*" is incompatible with parameter of type "LPCWSTR *"

  5. #5
    Join Date
    Apr 1999
    Posts
    27,418

    Re: help with strings

    Quote Originally Posted by theunknowncoder View Post
    ok so then on it all works fine untill it gets to the L"Play Modz" for the LPCWSTR *pwszButtons and then it gives me thist error
    Of course it gives you an error. Just as I responded to you in your other thread, that argument is not supposed to be a string. It is supposed to be an array of strings. The argument is an LPCWSTR*, not an LPCWSTR (see the * at the end of the first one).
    Code:
    LPCWSTR myStrings [] = {L"Play Modz"};
    z = XShowMessageBoxUI (XUSER_INDEX_ANY,L"Stelth V1",L"Thanks For Chossing Stelth V1. Stelth V1 Is Now Fully Loaded. HAVE FUN!!!",1, myStrings ,1,XMB_ALERTICON,NULL,NULL);
    I'll ask you the same question I asked in the other thread -- if you had 2 buttons, how would you have specified them in that function call? That's why you must use an array.
    Code:
    LPCWSTR myStrings [] = {L"Play Modz", L"Some Text"};
    z = XShowMessageBoxUI (XUSER_INDEX_ANY,L"Stelth V1",L"Thanks For Chossing Stelth V1. Stelth V1 Is Now Fully Loaded. HAVE FUN!!!", 2, myStrings ,1,XMB_ALERTICON,NULL,NULL);
    Do you see the code in red? I now have 2 strings, so my arguments are now 2, and the array of strings.

    Regards,

    Paul McKenzie
    Last edited by Paul McKenzie; October 7th, 2012 at 12:33 AM.

  6. #6
    Join Date
    Oct 2012
    Posts
    18

    Re: help with strings

    Quote Originally Posted by Paul McKenzie View Post
    Of course it gives you an error. Just as I responded to you in your other thread, that argument is not supposed to be a string. It is supposed to be an array of strings. The argument is an LPCWSTR*, not an LPCWSTR (see the * at the end of the first one).
    Code:
    LPCWSTR myStrings [] = {L"Play Modz"};
    z = XShowMessageBoxUI (XUSER_INDEX_ANY,L"Stelth V1",L"Thanks For Chossing Stelth V1. Stelth V1 Is Now Fully Loaded. HAVE FUN!!!",1, myStrings ,1,XMB_ALERTICON,NULL,NULL);
    I'll ask you the same question I asked in the other thread -- if you had 2 buttons, how would you have specified them in that function call? That's why you must use an array.
    Code:
    LPCWSTR myStrings [] = {L"Play Modz", L"Some Text"};
    z = XShowMessageBoxUI (XUSER_INDEX_ANY,L"Stelth V1",L"Thanks For Chossing Stelth V1. Stelth V1 Is Now Fully Loaded. HAVE FUN!!!", 2, myStrings ,1,XMB_ALERTICON,NULL,NULL);
    Do you see the code in red? I now have 2 strings, so my arguments are now 2, and the array of strings.

    Regards,

    Paul McKenzie
    thanks for all your help m8 i finally get this now after about 8 weeks thanks a lot

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center