M
MattWilson.6185
Hello!
I am trying to convert a char * to a LPWSTR, and I am going absolutly
mad! I can't find anything besides typle L"string" Unfortunetaly I
can't use that...
basicaly the setup is
callbackFromAnotherFunctionWhichMustBeOfChar(char* helpMe) {
//...
foo(some LPWSTR conversion);
}
this is the closest I have come to acomplishing this
char* convertMe = new char[sizeof(materials.pTextureFilename)];
strcpy(convertMe,materials.pTextureFilename);
wchar_t fileNameBuff[1];
int buffSize =
MultiByteToWideChar(CP_ACP,0,convertMe,strlen(convertMe),fileNameBuff,0);
LPWSTR gah = (LPWSTR)new wchar_t[buffSize];
MultiByteToWideChar(CP_ACP,0,convertMe,strlen(convertMe),gah,buffSize);
it converts all of the characters but I get a bunch of junk at the end
and I can't open the file.
Thanks
I am trying to convert a char * to a LPWSTR, and I am going absolutly
mad! I can't find anything besides typle L"string" Unfortunetaly I
can't use that...
basicaly the setup is
callbackFromAnotherFunctionWhichMustBeOfChar(char* helpMe) {
//...
foo(some LPWSTR conversion);
}
this is the closest I have come to acomplishing this
char* convertMe = new char[sizeof(materials.pTextureFilename)];
strcpy(convertMe,materials.pTextureFilename);
wchar_t fileNameBuff[1];
int buffSize =
MultiByteToWideChar(CP_ACP,0,convertMe,strlen(convertMe),fileNameBuff,0);
LPWSTR gah = (LPWSTR)new wchar_t[buffSize];
MultiByteToWideChar(CP_ACP,0,convertMe,strlen(convertMe),gah,buffSize);
it converts all of the characters but I get a bunch of junk at the end
and I can't open the file.
Thanks