Why does the following code from this answer work:
QString username = "Bond";
std::wstring username = username.toStdWString();
PCWSTR username = username.c_str();
When the following does not:
QString username = "Bond";
PCWSTR username = username.toStdWString().c_str();