void CmyPainterDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
CFile mfile=ar.GetFile();
char buf[100]="this should be ok!";
mfile.Seek(0L, CFile::begin);
mfile.Write(buf,sizeof(buf));
~~~
when i wana save a file as 111.tmp, whether it already exists or not, this error occur:
"cannot find file 111.tmp"
why

error in rewrite CDocment::Serialize()
Frank Roberts
CFile mfile=ar.GetFile();
GetFile returns a pointer.
Also why you are not using the standard << operator of the CArchive object
Also repsoitioning the file pointer in an archive may lead in an unexpected beahaviour. Just use the stream as it is.