Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

225 views
Skip to first unread message

Abhijit Bhadra

unread,
Dec 1, 2004, 5:37:05 AM12/1/04
to
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

Sharad Kala

unread,
Dec 1, 2004, 5:49:16 AM12/1/04
to

"Abhijit Bhadra" <abhijit...@ca.com> wrote in message

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

Sharad


Ron Natalie

unread,
Dec 1, 2004, 11:43:08 AM12/1/04
to
Abhijit Bhadra wrote:
> Hi ,
> I was trying to build my project in VC with latest Service Packs but
> got this error .
>
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.
0 new messages