void CChatClientDoc::SendFile(int mCode,CString m_name)
{
    
CFile file; 
file.Open("G:\\111.txt",CFile::modeRead|CFile::shareDenyWrite);
byte *buffer=NULL;
int fileLength=file.GetLength();
buffer=new byte[fileLength];
file.Read(buffer,fileLength);    CMsg msg;
        msg.m_UserName=m_name;
    msg.code = mCode;
    msg.m_strText = buffer;
if (m_pArchiveOut != NULL)
{

//消息预处理
//表明消息的来源

TRY
{
//发送消息
msg.Serialize(*m_pArchiveOut);
//将CArchive对象中数据强制存储到CSocketFile对象中
m_pArchiveOut->Flush();
}
CATCH(CFileException, e)
{
//错误处理
m_pArchiveOut->Abort();
delete m_pArchiveOut;
m_pArchiveOut = NULL;
CString strTemp;
strTemp.Format("发送失败");
DisplayMsg(strTemp);
}
END_CATCH
}
}上述程序只是其中一部分  整个程序是实现文字文件传输的   程序编译运行无错  但是执行文件传输功能时暴出  内存不可读提示    我通过断点调试  发现m_pArchiveOut m_pArchiveIn m_pSocket 等 无法识别   但是同样的方法 文字传输就可以   我将文件传输放到文字传输上  出现同样错误!!!