CString t_strFileName=m_FileList.GetItemText(m_pos,0);
CFileDialog fileDialog(FALSE,"*.*",t_strFileName,NULL,"文件(*.*)|*.*;||");
if (fileDialog.DoModal() == IDOK)
{
szLocalFileName=fileDialog.GetFileName();//将文件名存入成员变量
g_localpath=szLocalFileName;
g_remotepath=m_DirPath+"\\"+t_strFileName;
就到此处~:
调试到此m_DirPath="wav"
t_strFileName="abx.txt";
可气人的是g_remotepath竟为"\abx.txt"?
为什么》?
CFileDialog fileDialog(FALSE,"*.*",t_strFileName,NULL,"文件(*.*)|*.*;||");
if (fileDialog.DoModal() == IDOK)
{
szLocalFileName=fileDialog.GetFileName();//将文件名存入成员变量
g_localpath=szLocalFileName;
g_remotepath=m_DirPath+"\\"+t_strFileName;
就到此处~:
调试到此m_DirPath="wav"
t_strFileName="abx.txt";
可气人的是g_remotepath竟为"\abx.txt"?
为什么》?
CString strB = "tt.txt";
CString strC;
strC = strA +"\\"+strB;我用上面这段代码试了,没有问题啊,你在仔细检查一下。
===============
这个方法不错
m_DirPath = "wav";
t_strFileName="abx.txt";
g_remotepath = m_DirPath + "\\" + t_strFileName;代码应该是没有问题的
char szPathFile[MAX_PATH] ;
memset(szPathFile, 0x0 , MAX_PATH);
memcpy(szPathFile , m_DirPath.GetBuffer(0), m_DirPath.GetLength());
strcat(szPathFile ,"\\");
strcat(szPathFile , t_strFileName.GetBuffer(0), t_strFileName.GetLength());
ASSERT(szPathFile);