📄 subject_49519.htm
字号:
<p>
序号:49519 发表者:qiaofeng 发表日期:2003-08-11 16:03:31
<br>主题:有关CFile 的问题
<br>内容:在用CFile ff;<BR>ff.open()时,怎么打开程序所在目录的一个文件呢?比如程序在D:\1\目录下,我要打开<BR>D:\1\aa.txt,应该怎么用ff.open();就是open()函数里面的参数是什么?谁知道呀?
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:木一 回复日期:2003-08-11 16:17:05
<br>内容:CFile::Open <BR>virtual BOOL Open( LPCTSTR lpszFileName, UINT nOpenFlags, CFileException* pError = NULL );<BR><BR>Return Value<BR><BR>Nonzero if the open was successful; otherwise 0. The pError parameter is meaningful only if 0 is returned.<BR><BR>Parameters<BR><BR>lpszFileName<BR><BR>A string that is the path to the desired file. The path can be relative, absolute, or a network name (UNC).<BR><BR>nOpenFlags<BR><BR>A UINT that defines the file’s sharing and access mode. It specifies the action to take when opening the file. You can combine options by using the bitwise-OR ( | ) operator. One access permission and one share option are required; the modeCreate and modeNoInherit modes are optional. See the CFile constructor for a list of mode options.<BR><BR>pError<BR><BR>A pointer to an existing file-exception object that will receive the status of a failed operation<BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:qiaofeng 回复日期:2003-08-11 16:19:02
<br>内容:不是这个意思,我是说按我说的那样的话,参数应该是什么样子?就是实现打开d:\1\aa.exe的功能!
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:qiaofeng 回复日期:2003-08-11 16:36:26
<br>内容:UP一下
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:风之文章 回复日期:2003-08-11 16:57:17
<br>内容: CFile file;<BR> CString str_filename="d:\\1\\new.txt";<BR> file.Open(str_filename,CFile::modeRead|CFile::modeReadWrite,NULL);
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:qiaofeng 回复日期:2003-08-11 17:06:48
<br>内容:谢谢木一 、风之文章 的关注,我想实现的是打开程序所在目录里的文件,就是这个目录不是固定的,应该怎么做?
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:mxp 回复日期:2003-08-11 17:23:19
<br>内容:GetCurrentDirectory(DWORD nBufferLength,LPTSTR lpBuffer);<BR>DWORD nBufferLength:目录缓存的大小;<BR>lpBuffer:缓存的地址;
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:qiaofeng 回复日期:2003-08-11 17:35:22
<br>内容:谢谢木一 、风之文章 、mxp的大力帮助,谢谢你们这些好心人,新时代的活雷锋!<BR>2003-8-11 17:36:29
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -