看这个函数:
DWORD GetFullPathName(
LPCTSTR lpFileName, // pointer to name of file to find path for
DWORD nBufferLength, // size, in characters, of path buffer
LPTSTR lpBuffer, // pointer to path buffer
LPTSTR *lpFilePart // pointer to filename in path
);
DWORD GetFullPathName(
LPCTSTR lpFileName, // pointer to name of file to find path for
DWORD nBufferLength, // size, in characters, of path buffer
LPTSTR lpBuffer, // pointer to path buffer
LPTSTR *lpFilePart // pointer to filename in path
);
解决方案 »
- 关于下拉控件问题,请大神们帮帮忙。
- 怎样隐藏模态对话框的窗口?
- 我写的一个简单的图文混排的编辑器,大家去下载看看.
- 读取.ini配置文件下某个section的所有key的值
- 如何获得线程的上下文切换次数
- 如何在VC主程序里输出一个结构,让IE控件的JavaScript通过window.external调用该结构?
- VC++6.0的补丁怎么装?是不是必须SP1-6都要装?
- 如何取回SQL语句所影响的行数?(有确发器)
- MFC怎样截住WM_NCLBUTTONDBLCLK?
- 大家帮个忙。。。
- 我曾经的...失去了联络!可又能怪谁呢?如果你知道,我愿倾我所有(KAO,菜鸟)
- 谁能介绍介绍有关WTL的一些东西
your code.
CString retvalue = "";
CFileFind f;
BOOL bFind = f.FindFile( path + "*.*");
while ( bFind )
{
bFind = f.FindNextFile();
if ( f.IsDots() ) continue;
if ( f.IsDirectory() )
{
retvalue = retvalue + f.GetFileName() + "\\";
// 以下递归调用FindAllFiles(),取得所有子目录
FindFile( strParent + f.GetFileName() + "\\");
}
retvalue = strParent + f.GetFileName() ;
return retvalue;
}
f.Close();
return retvalue;
}
FindFirstFile/FindFirstFileEx,FindNextFile