Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

919 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now