?
Solved

MSVS2010 Release Build Error regarding CString::Compare wanting a wide character string

Posted on 2014-03-24
2
Medium Priority
?
271 Views
Last Modified: 2014-03-25
I am trying to build a Release build of my C++ project (for the first time) within MSVS2010 and the compiler has flagged an error within CString::Compare
specifically

error C2664:  'ATL::CStringT<BaseType, StringTraits>::Compare' : cannot convert parameter 1 from 'const char [11]' to 'const wchar_t *'

I see that Character Set (General Tab of config properties of project properties) is set to Use Unicode Character Set.
Character Set for my Debug build was "Not Set" which worked fine.
Is this what I get for not using the TCHAR macro T("foolish string") all over the place.
0
Comment
Question by:supportoranges
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 19

Accepted Solution

by:
mrwad99 earned 2000 total points
ID: 39952832
I am afraid so, yes.  If you don't need to use Unicode then I strongly suggest changing back to MBCS in the project settings, which I think is what is applied when "not set" is chosen.
0
 
LVL 1

Author Closing Comment

by:supportoranges
ID: 39952896
Ok.  There must be some reason Microsoft Release build defaults to Unicode so I will adjust my code to be more flexible when it comes to strings.  Thank you so much.  I really appreciate it!
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question