如何提取当前路径下的某一已知文件名的文件路径,
且把该文件路径在打开程序时默认显示在EDIT中!
且把该文件路径在打开程序时默认显示在EDIT中!
解决方案 »
- vc中打开MAT文件
- 救命啊,GetLastError返回了6,无效句柄错误,帮帮忙了
- visual c++技术内幕买第4版,还是第5版????
- “视”怎么和“对话框”通信?
- 求救1 "overloaded member function not found"
- 那位有写注册表的例程?(VC)急。。。
- 哪里有SQL2000的考试题下载,我正准备考MCSE,很急,回答有分!!!!
- 得到下载文件大小
- 关于Sprintf以及串口SetSettings的问题
- 这段程序看不懂,请指教
- 请大家为我们的爱祝福(我知道可能不应该发表在这里,但这里是我们的论坛)
- 如何能够取得传给自制IE控件的参数?<PARAM name="xxx" value="xxx">
LPCTSTR lpFileName, // file name
DWORD nBufferLength, // size of path buffer
LPTSTR lpBuffer, // path buffer
LPTSTR *lpFilePart // address of file name in path
);
cff.GetFilePath();
详细请看MSDN
详细请看MSDN
* creates a full path from a partial path.
*/#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <direct.h>char full[_MAX_PATH], part[_MAX_PATH];void main( void )
{
while( 1 )
{
printf( "Enter partial path or ENTER to quit: " );
gets( part );
if( part[0] == 0 )
break; if( _fullpath( full, part, _MAX_PATH ) != NULL )
printf( "Full path is: %s\n", full );
else
printf( "Invalid path\n" );
}
}
我用了以下的代码,可以在单击Button时选择文件路径,
但没法默认当前路径 CFileDialog dlg( TRUE );
if ( dlg.DoModal() == IDOK )
{
m_strFilePath = dlg.GetPathName();
UpdateData( FALSE ); }能不能提供GetCurrentDirectory()函数的用法详细到如上