hey guys, i'm running into an extremely weird problem.
i'm using VS2003.NET if that matters.
here are some relevant data structures being used, almost verbatim:
Code:
struct A
{
std::wstring Begin;
std::wstring End;
};
std::wstring TrimSpace(const std::wstring& value);
void SomeMethod()
{
// read from database into a Row using OLEDB
A a;
a.Begin = TrimSpace(row.Begin); // succeeds
a.End = TrimSpace(row.End); // sometimes fails
}
what i mean when i say it fails is that in the debugger, the value of a.End will show some messed up character (non-ascii) or ???. however, if i expand the value of the string in the debugger, the buffer (usually _Bx or _Buf) will show the correct value from row.End.
why is the wstring not getting the correct value stored? thanks.