Hi
You can use MFC base class to do it:
CString strContent = "";
CFile fRec;
CFileException e;
CString strUnit;
if ( !fRec.Open( strFile, CFile::modeRead | CFile::shareDenyNone, &e))
{
CString strMsg;
strMsg.Format( "Unable to Open File %s: error %d", strFile, e.m_cause);
AfxMessageBox( strMsg);
return .... what you want .. FALSE, ...
}
int nLength = ( int) fRec.GetLength();
// Allocate Memory to Read File
char* pszBuffer = new char [nLength + 1];
if ( pszBuffer == ( char*) NULL)
{
fRec.Close();
AfxMessageBox( "Memory Allocation Error !!! Unable to Read ..."

;
return .... what you want .. FALSE, ...
}
// Read File
fRec.Read( pszBuffer, nLength);
// Clean Up
fRec.Close();
You can store it in a CString
strContent = CString( pszBuffer, nLength);
Do not Forget to Clean up memory ...
// Free Memory
delete [] pszBuffer;
HTH
Thierry
EMail: Thierry.Marneffe@swing.be