Cómo convertir la cadena Platform^ en wstring y luego concatenar con una cadena L
Frecuentes
Visto 2,488 equipos
1
Toma lo siguiente:
highestScore->Data( ) // wchar_t *Platform::String::Data
startMenuItems.push_back( L"Highest score: " ); // startMenu is an array of wstring
¿Cómo hago lo siguiente?
startMenuItems.push_back( L"Highest score: " + highestScore->Data( ) );
Obtuve el siguiente error:
Error no operator "+" matches these operands
operand types are: const wchar_t[16] and const wchar_t*
Termina usándose aquí:
virtual HRESULT CreateTextLayout(
[in] const WCHAR * string,
UINT32 stringLength,
IDWriteTextFormat * textFormat,
FLOAT maxWidth,
FLOAT maxHeight,
[out] IDWriteTextLayout ** textLayout
) = 0;
para el 1er parámetro...
1 Respuestas
4
Prueba esto:
startMenuItems.push_back(
std::wstring(L"Highest score: ") + highestScore->Data());
Tu necesitas #include <string>
.
Respondido 14 Feb 14, 01:02
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas c++ or haz tu propia pregunta.