Hi,
I have a field whose decimal value is 36. I want to convert it to a 8 byte stream which will be represented as "00 00 00 00 00 00 00 24".
Now following is my code:
m_objDeviceDetail.strMerchantID.Format("%016d",_atoi64(m_objDeviceDetail.strMerchantID));
lngTemp=_atoi64(m_objDeviceDetail.strMerchantID);
if (lngTemp==0) return false;
ch=((lngTemp>>56) & 0xff);
strQBext.SetAt(0,ch);
ch=((lngTemp>>48) & 0xff);
strQBext.SetAt(1,ch);
ch=((lngTemp>>40) & 0xff);
strQBext.SetAt(2,ch);
ch=((lngTemp>>32) & 0xff);
strQBext.SetAt(3,ch);
ch=((lngTemp>>24) & 0xff);
strQBext.SetAt(4,ch);
ch=((lngTemp>>16) & 0xff);
strQBext.SetAt(5,ch);
ch=((lngTemp>>8) & 0xff);
strQBext.SetAt(6,ch);
ch=(lngTemp & 0xff);
strQBext.SetAt(7,ch);
But the out put I am getting is "00 00 00 24 00 00 00 24".
Can anyone help me to find out what should I do to get the desired result which is "00 00 00 00 00 00 00 24".
Thanks in advance