G
Gary Nastrasio
Let's say I have a function such as:
void ConvertCharToString(char* szInput, System::String^ strOutput)
{
strOutput = Marshal:trToStringAnsi(static_cast<System::IntPtr>(szInput));
}
Clearly if I call the function like this, it won't work because the
handle of strOutput is passed by value and cannot be changed by
Marshal:trToStringAnsi:
System::String^ strMyString;
ConvertCharToString("Some text", strMyString);
This is where I would normally use a pointer to pointer in C++...
What is the proper solution to this problem using the above function
prototype? Also, System::String^ ConvertCharToString(char* szInput); is
not an option.
Thanks guys!
Gary
void ConvertCharToString(char* szInput, System::String^ strOutput)
{
strOutput = Marshal:trToStringAnsi(static_cast<System::IntPtr>(szInput));
}
Clearly if I call the function like this, it won't work because the
handle of strOutput is passed by value and cannot be changed by
Marshal:trToStringAnsi:
System::String^ strMyString;
ConvertCharToString("Some text", strMyString);
This is where I would normally use a pointer to pointer in C++...
What is the proper solution to this problem using the above function
prototype? Also, System::String^ ConvertCharToString(char* szInput); is
not an option.
Thanks guys!
Gary