![]() |
【转帖】请问怎么样把一个CString类型的变量转换成BYTE类型,逆向的呢?
//第一种 CString To LPBYTE
CString strTemp="test"; BYTE* pTemp=(LPBYTE)strTemp.GetBuffer(0); //第二种 CString To LPBYTE CString strTemp2="test2"; BYTE byTemp[50]; memcpy(byTemp,strTemp2,strTemp2.GetLength()); byTemp[strTemp2.GetLength()]='\0'; //第三种 CString To LPBYTE CString strTemp3="test3"; LPBYTE pTemp2=new BYTE[strTemp3.GetLength()]; memcpy(pTemp2,strTemp3,strTemp3.GetLength()); pTemp2[strTemp3.GetLength()]='\0'; //............................................... //第一种 LPBYTE to CString CString strTemp4; strTemp4.Format("%s",(LPCSTR)pTemp2); //第二种 LPBYTE to CString CString strTemp5; strTemp5=(LPCSTR)pTemp2; 以上5种相互转换方式够你用的了。 Good Luck |
回复: 【转帖】请问怎么样把一个CString类型的变量转换成BYTE类型,逆向的呢?
Robust Spline Filter
|
所有的时间均为北京时间。 现在的时间是 09:51 AM. |