Cannot compile in Release mode

Dear Experts,

I have a VC++ application. I compiled and tested it in Debug mode without problems. Now as I need to make a release version, the compiler gives me many errors. E.g. here is the first one:
      CString strLastPage;
      strLastPage.Format("%d", pSheet->m_pPDFDoc->getNumPages());

Error      16      error C2664: 'void ATL::CStringT<BaseType,StringTraits>::Format(const wchar_t *,...)' : cannot convert parameter 1 from 'const char [3]' to 'const wchar_t *'      c:\Projects\VisualPDFConverter\VisualPDFConverter\WizPgSelectPageRange.cpp      59

Could you tell me why I am having this problem?
Thanks.
LVL 1
tantormediaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

JohnGabyCommented:
Is your debug version using multibyte and your release version using unicode?
jkrCommented:
The release version seems to be set to compile as UNICODE whereas your debug version uses MBCS. Open your project settings (ALT+F7), go to 'Configuration Properties|General" and change 'Character Set' to 'Use Multi-Byte Character Set'.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tantormediaAuthor Commented:
Thank you very much!
Could you tell how it even happened that I had different settings for Debug and Release? I didn't do it.
jkrCommented:
Hm, UNICODE is the default for more recent versions of Visual Studio, so I guess at one point you switched the debug version to MBCS accidentally or without really noticing it...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.