采取以下措施:
highestScore->Data( ) // wchar_t *Platform::String::Data
startMenuItems.push_back( L"Highest score: " ); // startMenu is an array of wstring
如何执行以下操作?
startMenuItems.push_back( L"Highest score: " + highestScore->Data( ) );
我收到以下错误:
Error no operator "+" matches these operands
operand types are: const wchar_t[16] and const wchar_t*
最终会在这里使用:
virtual HRESULT CreateTextLayout(
[in] const WCHAR * string,
UINT32 stringLength,
IDWriteTextFormat * textFormat,
FLOAT maxWidth,
FLOAT maxHeight,
[out] IDWriteTextLayout ** textLayout
) = 0;
表示第一个参数...
答案 0 :(得分:3)
试试这个:
startMenuItems.push_back(
std::wstring(L"Highest score: ") + highestScore->Data());
您需要#include <string>
。