I am using the below code to read the image data. It is of 3922126 length. But after reading it. b_FileData stores only three bytes. How to read the image(bitmap) fully and save it in bytes in order to store it in the database.
LPBYTE b_FileData = NULL;
CFile m_file;
DWORD l_Filelen;
m_file.Open(lpszName,CFile::modeRead | CFile::modeNoTruncate);
m_file.SeekToBegin();
l_Filelen = m_file.GetLength();
b_FileData = new BYTE[l_Filelen];
m_file.Read(b_FileData,l_Filelen);
m_file.Close();