I am new on Using with dotnet platform. Previously I have Experience on working with VC++ 6.0.
On this exp, I hav choose VC++.Net for my current Project... By understanding the UNICODE fromats, I was going on right way(Extremely with the helps of CodeGuru team)
Here I am receiving some Datas from an Extenal PC Board via Serial Port.
The Data Receiving as ASCII format and I have stored it on a CString FirstData.
The following codes explains it.
Here I wanna convert this CString value ll to an int Hex Format and print it on a file....Code:CString FirstData;// already declared and here reads Data from Serial Port for(int i=0;i<FirstData.GetLength();i++) { int ibyte; CString ll; ll=FirstData.GetAt(i); sscanf(ll,"%x",&ibyte) }
But it is not working here.error Message came as "Cannot convert parameter 1 from CString to const char*.
Next I have changed sscanf as
It has worked...But when I read the data ibyte..it is wrong(some error datas are printed)Code:_stscanf(ll,_T("%x),&ibyte);
Again I used atoi function--still error values came.
How do I convert the exact data to an int Format.plz help...




Reply With Quote
