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

Thread: Please Help!!!!

  1. #1
    Join Date
    May 1999
    Posts
    89

    Please Help!!!!


    How to compare a wide string with a const char* ???
    unsigned short* wideString;

    wcscmp(wideString, "myName") won't work!!!! even with casting!
    Any help is much much appreciated!!!




  2. #2
    Join Date
    May 1999
    Location
    OR, USA
    Posts
    65

    Re: Please Help!!!!

    Don't try type-casting!!! All it will do is convince compiler that "myName" is a wide string
    which it is not
    So convert const char * to wchar * and then use wcscmp.
    I don't remember the exact name of the function but I think it starts with mbcs...



  3. #3
    Join Date
    May 1999
    Location
    Texas, USA
    Posts
    568

    Re: Please Help!!!!

    Have you tried this:
    wcscmp(wideString, L"myName");


    The 'L' converts the string to a wide string.

    Wayne



Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured