G
Guest
Hi Guys,
I have read a string from Unmanaged code, however, when I convert ptr to
string.
It also include "\r\n" in the string, how to avoid this issue:
here is my source code:
IntPtr m_pMessge = new IntPtr(0);
// this call native code [dll file]
ReplayForm(ref m_pMessge,this.E_User,this.E_Password);
//convert pointer to object string
string strMessage = Marshal.PtrToStringBSTR(m_pMessge);
/*****
after it has been converted, it holds \r\n ""
*/
strMessage = strMessage.Replace(@"=\r\n", @"\r\n");
Thanks
I have read a string from Unmanaged code, however, when I convert ptr to
string.
It also include "\r\n" in the string, how to avoid this issue:
here is my source code:
IntPtr m_pMessge = new IntPtr(0);
// this call native code [dll file]
ReplayForm(ref m_pMessge,this.E_User,this.E_Password);
//convert pointer to object string
string strMessage = Marshal.PtrToStringBSTR(m_pMessge);
/*****
after it has been converted, it holds \r\n ""
*/
strMessage = strMessage.Replace(@"=\r\n", @"\r\n");
Thanks