用open創建了 打開就是失敗路徑都一樣的咋回事



uj5u.com熱心網友回復:
檔案存在嗎?換絕對路徑試試?或者./Student.dat直接寫成Student.dat?再失敗就DWORD er = GetLastError();看看是什么錯誤碼
uj5u.com熱心網友回復:
不建議用相對路徑,這個會引發很多不確定的問題!!!使用絕對路徑!!!!
uj5u.com熱心網友回復:
GetModuleFileName 獲取應用程式路徑,再加上檔案名,比較好的做法uj5u.com熱心網友回復:
不支持 ./ 的路徑使用標準的 "\\" 或者全路徑
uj5u.com熱心網友回復:
the first, please try to use ".\\" to specify the path from rootthe second, I have remember CFile Open have a CException when fail, please use CException to know the reason
uj5u.com熱心網友回復:
檔案路徑應該是https:\\bbs.csdn.net\\topics\\392564497這個格式吧而不是AAA/VVV/uj5u.com熱心網友回復:
應該是低級錯誤,創建檔案以后,如果在一個代碼塊中,不需要再open,因為此時檔案已經open,如果在其他塊中,在createfile塊中,需要close(fp),否則檔案一直被這個快占用,別的塊無法openuj5u.com熱心網友回復:
創建檔案以后,不需要再open轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/48579.html
標籤:基礎類
