Hello, I've trouble with this code:

Code:
#ifdef UNICODE
static std::wstring GetConfigDependentString(const std::string& str);
#else
static std::string GetConfigDependentString(const std::string& str);
#endif

...

#ifdef UNICODE
std::wstring CCoreUtils::GetConfigDependentString(const std::string& str)
{
	return CCoreUtils::UTF8ToUTF16(str);
}
#else
const std::string CCoreUtils::GetConfigDependentString(const std::string& str)
{
	return str;
}
#endif

...

void CCoreUtils::MyFunc(const std::string& dialogTitle)
{
	OPENFILENAME ofn;
	...
	ofn.lpstrTitle = CCoreUtils::GetConfigDependentString(dialogTitle).c_str();
	...
}
The project is configured to use the Multi-Byte Character Set (ie. UNICODE is not defined). However, when I call MyFunc(...), in ofn.lpstrTitle there is nonsense after the assignment. How is that possible? The class CCoreUtils is also used in another project built with UNICODE defined, but it gives me nonsense even if I choose Rebuild Solution for this (non-UNICODE) project.