I try to modify a file name by CFile::Rename(temp.txt,temp.rtf),system
prompt "access to temp.txt denied".
How can I solve it ? Thank you!

Re: CFile Rename fail by Mark

Mark
Fri Jul 25 12:36:24 CDT 2008

"wangyang" <wangyang@hotmail.com> wrote in message
news:#tWbgOg7IHA.4864@TK2MSFTNGP06.phx.gbl...
> I try to modify a file name by CFile::Rename(temp.txt,temp.rtf),system
> prompt "access to temp.txt denied".
> How can I solve it ? Thank you!


Maybe you don't have sufficient permissions to rename the file?

The CFileException thrown has the error code...what is it?

Mark

--
Mark Salsbery
Microsoft MVP - Visual C++



>
>

Re: CFile Rename fail by Tim

Tim
Sat Jul 26 22:03:14 CDT 2008

"wangyang" <wangyang@hotmail.com> wrote:
>
>I try to modify a file name by CFile::Rename(temp.txt,temp.rtf),system
>prompt "access to temp.txt denied".
>How can I solve it ? Thank you!

Are you still writing to "temp.txt"? You need to close it first.
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.