473,748 Members | 2,502 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

error C2440: 'return' : cannot convert from 'const char *' to 'const unsigned short *' Types pointed to are unrelated; conversion requires reinterpret_cas t, C-style cast or function-style cast

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\atlcon v.h(125) : error C2440: 'return' :
cannot convert from 'const char *' to 'const unsigned short *'
Types pointed to are unrelated; conversion requires
reinterpret_cas t, 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
Jul 22 '05 #1
2 11528

"Abhijit Bhadra" <ab************ @ca.com> wrote in message
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\atlcon v.h(125) : error C2440: 'return' :
cannot convert from 'const char *' to 'const unsigned short *'
Types pointed to are unrelated; conversion requires
reinterpret_cas t, 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 .


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
Jul 22 '05 #2
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.
Jul 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2985
by: Julius Mong | last post by:
Hi all, I'm doing this: // Test char code wchar_t lookup = {0x8364, 0x5543, 0x3432, 0xabcd, 0xef01}; for (int x=0; x<5; x++) { wchar_t * string = (wchar_t*) malloc(sizeof(wchar_t)); string = (wchar_t*)lookup; string = '\0'; CComBSTR bstrTest = SysAllocString(string); }
3
31511
by: Siemel Naran | last post by:
Hi. Is there a way to convert the type signed int to the type unsigned int, char to unsigned char, signed char to unsigned char, and so on for all the fundamental integer types? Something like template <> struct to_unsigned<signed int> : public std::unary_function<signed int, unsigned int> { unsigned int operator()(signed int x) const { return x; } };
1
1306
by: DiskMan | last post by:
System: Redhat 7.2 Kernel-2.6.11.8 GCC-3.4.3 CCC-6.5.9 Binutils-2.15 Make-3.80 GTK/GLIB-2.6.7 For some reason my Linux box is suddenly having issues trying to read ;
2
2281
by: Alper AKcayoz | last post by:
Hello Esteemed Developers I am trying to develop basic TCP/IP Server-Client programs at the Visual C++ .NET, using Windows Forms Application(.NET) template. I coded the following code snippets FORM1. -------------------------------------------------------------------------------------------------------------------- public __gc class Form1 : public System::Windows::Forms::For .. public #define PORT 2222
12
10088
by: GRoll35 | last post by:
I get 4 of those errors. in the same spot. I'll show my parent class, child class, and my driver. All that is suppose to happen is the user enters data and it uses parent/child class to display it. here is the 4 errors. c:\C++\Ch15\Employee.h(29): error C2440: '=' : cannot convert from 'char ' to 'char '
26
11741
by: =?gb2312?B?wNbA1rTzzOzKpg==?= | last post by:
i wrote: ----------------------------------------------------------------------- ---------------------------------------- unsigned char * p = reinterpret_cast<unsigned char *>("abcdg"); sizeof(reinterpret_cast<const char *>(p)); ----------------------------------------------------------------------- ---------------------------------------- the compiler tells me that "reinterpret_cast from type "const char * " to type "unsigned char *"...
4
1822
by: Christopher Benson-Manica | last post by:
In a thread from substantially earlier this week, Harald van D?k <truedfx@gmail.comwrote: Being rather pendantic, I decided to try to verify whether this was true. I would appreciate knowing whether my reading of the Standard is correct. 7.19.7.1 (as we all know) states that fgetc() (and thus its friends)
11
12777
by: hamishd | last post by:
Is this possible? Sorry if this question isn't relevant here. actually, I'm really trying to convert a unsigned char * to an int
2
20464
by: slizorn | last post by:
error is as stated in the topic above: error C2440: '=' : cannot convert from 'char *' to 'char' code is below void handleOneLine(string string1) { char * cstr, *p; int counter; string str (string1);
10
3786
by: Alex Vinokur | last post by:
Hi, Is it possible to do C++-casting from const pair<const unsigned char*, size_t>* to const pair<unsigned char*, size_t>* ? Alex Vinokur
0
9366
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9316
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9241
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8239
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6793
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4867
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3303
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2777
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2211
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.