I was using AnsiString to store the Key for the Context. This was the real problem because in pascal AnsiString is not single byte. As @CodeInChaos focused on AnsiString, I checked it and found it. So i had replaced the
Key: AnsiString
To
Key : Array [0..32] of Char;
and it successfully worked.
Thank you @CodeInChaos.