char in LPWSTR converten

10/17/2015 21:06 DiiViiSioN#1
German:

Hallo Leute,
ich habe ein D3D9 Menü und die Items funktionieren auch wenn man sie auswählt aber da ist kein Text zusehen. Das Problem liegt an der Stelle:

Code:
	
char	sTexto[1024] = "";

	va_list	ap;

	if( !sNome || *sNome == '\0' )
		return;

	va_start( ap, sNome );
	_vsnprintf_s( sTexto, 1024, 1023, sNome, ap );
	va_end( ap );

	RECT Posicao = { X, Y, X+500, Y+50 };		


	fonte->DrawText(NULL, sTexto, -1, &Posicao, DT_LEFT | DT_WORDBREAK, Cor);
Man kann nicht auf die Variable sTexo zugreifen, da sie LPWSTR sein muss deswegen habe ich folgenes hinzugefügt:

Code:
	wchar_t Texto[1024];
	mbstowcs(Texto, sTexto, strlen(sTexto));
	LPWSTR endtext = Texto;
Nun ist sie umgewandelt aber irgendwo ist ein Fehler, da kein Text im Menü angezeigt wird.



ENGLISH:

Hey guys I've gotten an error. I got a D3D menu and this works but there is no text when I convert char to LPWSTR.
I tried to convert with the mbstowcs method

applied this:
Code:
	wchar_t Texto[1024];
	mbstowcs(Texto, sTexto, strlen(sTexto));
	LPWSTR endtext = Texto;

But when I open the menu ingame I cant see the text but the Items are working. Where is the mistake?


Thanks for help,
Diiviision
10/17/2015 21:54 Nanoxx™#2
PHP Code:
LPCWSTR B;
std::string AString "MeinText";
= (LPCWSTR)s.c_str(); 
10/17/2015 22:25 DiiViiSioN#3
Quote:
Originally Posted by Nanoxx™ View Post
PHP Code:
LPCWSTR B;
std::string AString "MeinText";
= (LPCWSTR)s.c_str(); 
//edit: habs danke für diehilfe