I'm have some problems converting this code to VB
DWORD dBitField = (DWORD)(*(unsigned __int64 *)(m_Data+pos/8)<<(64-len-(pos&7))>>(64-len));
Heres what I have so far..
Dim dBitField As Long
dBitField = LShift(m_Data + Pos / 8, 64 - Leng - Pos & 7)
dBitField = RShift(dBitField, 64 - Leng)
This is what I do not understand.
(DWORD)(*(unsigned __int64 *)
and
pos&7
Can someone please explain to me what this code is doing?
Thanks.
(*(unsigned __int64 *) is a C style typecast, basically changing m_Data+Pos/8...whatever to an unsigned __int64 (64 bit unsigned integer).
& is bitwise and operator. In VB you use And].
(DWORD)(*(unsigned __int64 *) can safely be declared as Long in VB.
Thanks for the help. :)