debug assertion failed! file:fseek.c
FILE * pFile;
pFile=fopen("cityPath.data","wt+");
if(dlgfile.DoModal()==IDOK)
{
strExe=dlgfile.GetPathName();
m_fileothername=dlgfile.GetFileTitle();
fwrite(strExe,1,strlen(strExe),pFile);
//menu.GetSubMenu(0)->EnableMenuItem(2,MF_BYPOSITION|MF_GRAYED|MF_DISABLED );
}
else
return;
fclose(pFile);
/////////////////////////////////
CDialog::OnInitDialog();
COleVariant var;
CString m_fileothername;
CsoDataSource Datasource;
FILE* pPath;
pPath=fopen("cityPath.data","rt");
CString strExe;
char* pBuf;
fseek(pPath,0,SEEK_END);//运行到这里就出错了
int len=ftell(pPath);
pBuf=new char[len+1];
memset(pBuf,0,len+1);
rewind(pPath);
fread(pBuf,1,len,pPath);
strExe.Format("%s",pBuf);
fclose(pPath);
cityPath.data 我已经把它放在了当前工程里了,出现的是
debug assertion failed!
program:...
file:fseek.c
line:101
expression:stream!=null