Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 Not recognized identifier
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

znakeeye
Tomato Guru

379 Posts

Posted - Jan 13 2009 :  06:46:27 AM  Show Profile  Reply with Quote
VAX 1649, VS 2008 SP1. In certain scenarios CStringT::CompareNoCase is not recognized, and becomes underlined:
class CStarterInfo : public CCommandLineInfo
{
public:
	CStarterInfo() {}
	virtual ~CStarterInfo() {}

	virtual void ParseParam(const TCHAR* pszParam, BOOL bFlag, BOOL bLast)
	{
		CString strParam(pszParam);
		if (0 == strParam.Left(7).CompareNoCase("config="))
			m_strConfig = strParam.Mid(7);
	}

	CString				m_strConfig;
};

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Jan 13 2009 :  7:08:42 PM  Show Profile  Reply with Quote
Your example actually does not compile. I do not have experience with CString (I use my own class for string), so can you help me, how to get this compiled?

I created an empty class for CCommandLineInfo:

class CCommandLineInfo {};

and included the necessary header:

#include <atlstr.h>

but get this error message:
error C2664: 'ATL::CStringT<BaseType,StringTraits>::CompareNoCase' : cannot convert parameter 1 from 'const char [ 8]' to 'const wchar_t *'

Maybe I need to #define something or to use a compiler directive?
Go to Top of Page

znakeeye
Tomato Guru

379 Posts

Posted - Jan 14 2009 :  03:09:20 AM  Show Profile  Reply with Quote
Just create an MFC project and choose "Multibyte character"-configuration. CString and CCommandLineInfo are part of MFC.
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Jan 14 2009 :  6:18:50 PM  Show Profile  Reply with Quote
Thanks for your help. I have put in a bug report for this:

case=22866

I was able to compile your example by unchecking "Use unicode libraries" in the new MFC Application wizard.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000