Solved

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

Posted on 2014-03-24
2
270 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 500 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

696 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