I need a 32 length null-terminating LPTSTR equivalent in C#, does it exist?
Printable View
I need a 32 length null-terminating LPTSTR equivalent in C#, does it exist?
Can you pass a 32 element char array?
Use stringbuilder.
Well the context is, I need to pass something to this parameter:
LPTSTR lpszReturnString
I know that in VB 6, this did the trick perfectly:
VB Code:
Dim sReturn As String * 30
I just passed sReturn to the function and it filled it and sent it back my way. It worked. Now of course that notation for initializing a string has become obsolete. So I need a replacement, preferably in C# because of it's evident coolness.
You can use the stringbuilder or the string type. .NET will take are of the rest :DCode:StringBuilder sReturn = new StringBuilder();
Well, err, it didn't. Can you give me an example of how you would create the required object?