error C2440: 'return' : cannot convert from 'const char *' to 'const unsigned short *' Types pointed

Discussion in 'C++' started by Abhijit Bhadra, Dec 1, 2004.

  1. Hi ,
    I was trying to build my project in VC with latest Service Packs but
    got this error .

    C:\Program Files\Microsoft Visual
    Studio\VC98\ATL\INCLUDE\atlconv.h(125) : error C2440: 'return' :
    cannot convert from 'const char *' to 'const unsigned short *'
    Types pointed to are unrelated; conversion requires
    reinterpret_cast, C-style cast or function-style cast

    I am using some ATL functionality ( String conversion)
    In Preprocessor setting I have made UNICODE and _UNICODE , but no
    change in error .

    Any help is highly solicited .

    Thanks,
    Abhijit
     
    Abhijit Bhadra, Dec 1, 2004
    #1
    1. Advertisements

  2. Abhijit Bhadra

    Sharad Kala Guest

    You have to post some code to get better replies. If it has a lot of
    non-Standard stuff then try the family of newsgroups.

    Sharad
     
    Sharad Kala, Dec 1, 2004
    #2
    1. Advertisements

  3. Abhijit Bhadra

    Ron Natalie Guest

    unsigned short is a goofup on Microsoft's part because wchar_t isn't
    a distinct type there. When you seem char vs. unsigned short issues,
    you've screwed up a char vs. wchar_t somewhere.
     
    Ron Natalie, Dec 1, 2004
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.