char * zu LPCWSTR <<< GELÖST
-
wie convertiere ich char* zu LPCWSTR ?
bitte um hilfe!
-
Der Datentyp heißt "Long Pointer Char Wide String". Du solltest dir die Funktion MultiByteToWideChar() anschauen.
-
MSDN http://msdn.microsoft.com/en-us/library/ms235631.aspx
char * ptrTorecbuff= "This is a test!"; size_t newsize = strlen(ptrTorecbuff) + 1; // The following creates a buffer large enough to contain // the exact number of characters in the original string // in the new format. If you want to add more characters // to the end of the string, increase the value of newsize // to increase the size of the buffer. wchar_t * wcstring = new wchar_t[newsize]; // Convert char* string to a wchar_t* string. size_t convertedChars = 0; mbstowcs_s(&convertedChars, wcstring, newsize, ptrTorecbuff, _TRUNCATE);
-