| 发表于:2007-09-18 16:31:481楼 得分:10 |
char* pfilename = "config/clientconfig.txt "; f.open( pfilename, cfile::moderead, &e ); dwactual = f.getlength(); m_str.fromat( "%d ",dwactual); f.close(); delete pfilename; file的路径应该是绝对的路径不应该是相对的路径,先获得当前的路径 char szpath[256]; getcurrentdirectory(256,szpath); strcat(szpath, "\\ "); strcat(szpath, "config\\clientconfig.txt "); f.open( szpath, cfile::moderead, &e ); dwactual = f.getlength(); m_str.fromat( "%d ",dwactual); f.close(); 还有你的 char* pfilename = "config/clientconfig.txt "; delete pfilename 是错误的- -~! | | |
|