提供一个创建文件函数:int CCommonFunc::CreateDirectory(char *pPath)
{
CString stPath;
stPath =pPath;
if(stPath.IsEmpty()) return -1;
if(stPath.Mid(stPath.GetLength()-1)!="\\")
stPath +="\\";
int iPos;
iPos =stPath.Find("\\",0);
CString stDir;
while(iPos>=0)
{
stDir =stPath.Left(iPos);
_mkdir(stDir);
iPos =stPath.Find("\\",iPos+1);
}
return 0;
}
{
CString stPath;
stPath =pPath;
if(stPath.IsEmpty()) return -1;
if(stPath.Mid(stPath.GetLength()-1)!="\\")
stPath +="\\";
int iPos;
iPos =stPath.Find("\\",0);
CString stDir;
while(iPos>=0)
{
stDir =stPath.Left(iPos);
_mkdir(stDir);
iPos =stPath.Find("\\",iPos+1);
}
return 0;
}
解决方案 »
- 删掉一对话框后 运行不了
- 怎样使单文档窗口的垂直滚动条只作用于部分窗体?
- 用下面的程序如何判断我点击了鼠标右键?
- 简单的问题,偶的MSDN丢了。。郁闷。。。求救
- 程序运行的虚拟内存增长问题。
- 可以在CTabCtrl上的tab页面上直接画图么应该怎样做?
- 请问以前的程序中做的面板资源和面板类怎么在新的程序中使用?
- 这个东东是什么
- 请问this->SendMessage(WM_COMMAND,GetDlgCtrlID(),(LONG)GetSafeHwnd())中WM_COMMAND指的是什么消息啊
- 怎么样删除文件CFile类
- 晕了,居然没找到MFC的ODBC更新指定字段的方法,求助!!
- 好多资源呀!!快抢!!
调用手动保存也行。
如果要是想保存在特定的文件夹下
要么手动输入,否则还是要用我说的这个方法