Click here to Skip to main content
16,022,364 members

Comments by farhadkhalili (Top 1 by date)

farhadkhalili 11-Feb-11 3:38am View    
I did, but it's not working. To convert from string to IntPtr, I do this:
IntPtr lpData = Marshal.StringToHGlobalUni(TextBox1.Text);
and to convert IntPtr to string:
string str = new string((char*)(data.lpData),
0, data.cbData/2);
But it's not working. The result is eather null or some invalid characters!
I'm really confused!