<code></code>unsigned char ret1[1],pet[3],pet1,k;
BYTE ret[10];
int y,y1;
CString exp,exp1;
CFileDialog FileDlg(TRUE, 0, 0, 0, _T("Raw Files (*.BIN)|*.BIN||"));
if( FileDlg.DoModal() == IDOK)
{
f=FileDlg.GetPathName();
f1=FileDlg.GetFileName();
cfile_object.Open(f,CFile::typeBinary|CFile::modeReadWrite);
}
int rr;
CString str;
cfile_object.Seek(0,CFile::begin);
cfile_object.Read(ret,1);
str.AppendChar(ret[0]);
AfxMessageBox(str);
char c[10];
byte b;
for(int y=0, x=0; y<1; ++y, ++x)
{
b=((byte)(ret[0]>>4));
c[x]=(char)(b>9 ? b+0x37 : b+0x30);
f1=c[x];
b=((byte)(ret[0]&0xF));
c[++x]=(char)(b>9 ? b+0x37 : b+0x30);
f1.AppendChar(c[x]);
AfxMessageBox(f1);
}
cfile_object.Close();
Finally I got it . Here it is , I wrote it referring to a code on Visual C# because wrt MFC , i was not getting any help. There are a lot of unused variables, I forgot to flush them .
Thanks to all who answered my query . It did open up my concept a bit . Thanks guys . Y'all Rock . :) . :D .