G
Gary Nastrasio
Is it possible to use "normal" C types with garbage collection? Here's
the function I'd like to write, but not have to worry about deallocation:
char* ConvertStringToChar(String* pString)
{
const wchar_t __pin *pStrChars;
char* pOutString = (char*)malloc(sizeof(char) * 256);
pStrChars = PtrToStringChars(pInString);
wcstombs(pOutString, pStrChars, (pInString->Length + 1) * 2);
return pOutString;
}
And then use it such as:
MessageBoxA(NULL, ConvertStringToChar(new String("Hello")), "Test", MB_OK);
Thanks,
Gary
the function I'd like to write, but not have to worry about deallocation:
char* ConvertStringToChar(String* pString)
{
const wchar_t __pin *pStrChars;
char* pOutString = (char*)malloc(sizeof(char) * 256);
pStrChars = PtrToStringChars(pInString);
wcstombs(pOutString, pStrChars, (pInString->Length + 1) * 2);
return pOutString;
}
And then use it such as:
MessageBoxA(NULL, ConvertStringToChar(new String("Hello")), "Test", MB_OK);
Thanks,
Gary