how to rename a file #2

What MFC class/function would I use to rename a file.  Assume the file is
not being accessed by any application.   I have typically used the C run
time library function 'rename' but his there a comparable MFC or SDK
function?

Thanks

Ian





0
ibnospam (19)
2/7/2005 3:53:33 AM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
830 Views

Similar Articles

[PageSpeed] 11

Hi,
You could use CFile::Rename.

Regards

Andy Mortimer [MS]
Please do not send email directly to this alias. This alias is for 
newsgroup purposes only

This posting is provided "AS IS" with no warranties, and confers no rights. 
OR if you wish to include a script sample in your post please add "Use of 
included script samples are subject to the terms specified at 
http://www.microsoft.com/info/cpyright.htm" 


0
andmort (67)
2/7/2005 11:35:10 AM
Reply:

Similar Artilces:

Cannot read Attached files
I am not able to read attached files. At link the file name is displaying but it is disable one, cannot open one. Please help to retrieve the attachments comes through my mail. Thank you. Khan in outlook or ms outlook there is an option for not openning attachments, i believe under tools ===accounts-- then look for a section where is says disable or enable attachments, if not email me at ianfuentes@hotmail.com will give you exact procedure >-----Original Message----- >I am not able to read attached files. >At link the file name is displaying but it is disable >one, cann...

normal.dot file and macros
I have used Microsoft WORD 2000 for many years and had no problem with Macros. Now I installed WORD 2003 on a different computer and cannot find the normal.dot file even with changing folder's settings to view hidden files. There is nothing visible in templates under Microsoft unless I create one, and normal.dot does not come up with an file explorer search. I can create macros in normal.dot in the WORD process I normally used in Word 2000, and they apply to all open files. However, when I closed word and re-open, I have no working Macros. Therefore, I need help on ...

Synching between 2 exchange servers
Hi everybody, we have 2 exchange 2003 servers which are also domain controllers . Every 2-3 weeks the two DCs seem to have a problem communicating with each other causing the exchange services to stop. The SA does not start. start and the only way to resolve the problem is to reboot both servers on the WAN. I get an event ID 2104 and 2114 in the application event viewer. Also see events in the system log. They just inform me that exchange MTA and Information store did not start because the system attendant is not running. No message tells me why this is occuring. I do think that the 2 ...

missing WAB.dll #2
I am running Outlook 2000 and have a new system with Windows Vista. When I attempt to create a new .PST file in Outlook, I get a message that the Windows Address Book cannot be opened, that the WAB.dll file cannot be found. Does this mean that I don't have Outlook Express? I have IE7 and it seems that Outlook Express pertains to IE6. I've downloaded a WAB.dll file and have placed that in my Windows system32 folder and after rebooting I still get the same error. What should I do so that I can create a new .PST file from Outlook? Thanks. Outlook 2000 on Vista? Not even possible, ...

Adding Date to File Name on Save
Is there a way to save a workbook under a "new" name by automatically adding the date when saving on exit? Idea is to ensure previous version is kept as a back-up and allow other users of same file to access the most up-to-date version. Many thanks for any help. David I don't believe you can force a workbook to be saved under another name unless it is "read-only". As a developer you might add a button or keyboard shortcut that runs a macro to do the save. The macro could always make the current date part of the file's name. Something like: ThisWorkbo...

How do I branch to another sheet in the same file?
I have a file with multiple sheets. Depending on who uses the file, I want them to be able to click on a button (or other object) and have it display one of the other sheets. It seems like this should be simple but can't quite figure it out. I really don't want ot get involved with writing macros. Thank you for any help! 1. Please make use of a Hyperlink. Regards. Here's an example. Assume your sheets are all numbered consecutively, i.e. Sheet1, Sheet2, Sheet3, Sheet4 etc, then in Sheet1 cell A1 you enter a number. In B2 enter this formula: =HYPERLINK("#Sheet"&a...

Some question about different files
Hello! When I create a default SDI MFC application some files are generated. There are two file that I have questions about. These are Mainframe.h/cpp and TestView.h/cpp In my case the project has name test so the file was called TestView.h/cpp. The actual main frame window that the application creates is the mainframe file and has the following definition. Class CMainFrame is derived from CFrameWnd like class CMainFrame : public CFrameWnd. As I think a view as in filename testview should also be a window but I don't have two windows. The class CTestView is deriverd from CView like ...

Internal Mail Address #2
Hi, I have an Exchange 2003 organization. I would like to know if it is possible to restrict an address (like company@company.com) only for the local users. In fact, only the employees can use this address, and nobody else. Thanks. Mike Essentially that is part of registering your domain and then having your MX send to your mail system. Maybe I am not completly following your question though. Do you have multiple sites and you only want your site to be able to recieve email sent to @company.com? "Mikaël PLOUHINEC" wrote: > Hi, > > I have an Exchange 2003 ...

File Size
What is the easiest way to find out the size of a file. Thanks, Ken GetFileSize[Ex]() API's or GetFileAttributesEx() API. -- Cheers Check Abdoul [VC++ MVP] ----------------------------------- "Ken->" <handsom@comcast.netspicedham> wrote in message news:ArqdnddlcZoeuqfdRVn-uw@comcast.com... > What is the easiest way to find out the size of a file. > Thanks, > Ken > > Tell us what are the functions you have in mind "Ken->" <handsom@comcast.netspicedham> a �crit dans le message de news: ArqdnddlcZoeuqfdRVn-uw@comcast.com.....

Rename Server
I was would like to know if it is possible to rename a server on which Exchange 2000 has been install onto, would this have an effect on exchange wayne The Exchange services won't start after a server rename. Build a new server with the new name and move the mailboxes to it. -- Neil Hobson Exchange MVP http://www.msexchange.org/Neil_Hobson/ "WB" <wmb2003@zoom.co.uk> wrote in message news:u5TGyDCpGHA.2360@TK2MSFTNGP05.phx.gbl... >I was would like to know if it is possible to rename a server on which >Exchange 2000 has been install onto, would this have ...

Office v. X 10.1.2 Update Problem! Can't find office installation
Hello, i know that there are many other postings regarding the update problem but all the tipps provided didn't solve my problem. If i run the "Office v. X 10.1.2 Update" the installer says that Office is not installed on my machine but this is not true. I tried the following with various tries of starting the update again: - Start the disk / permission util - Renamed the Office folder to "/Applications/Office" - Moved the Office folder to "/Office" - Removed the network plug I reinstalled the Office a couple of times and also reinstalled the whole OS X 10...

What files do I want to back up from Outlook 2007 ?
What files do I want to back up from Outlook 2007 ? I had Office 2007 running my registry had an issue and I now have to reinstall my programs. I can not get my code to reload Office 2007 because my code was stored in an email from Microsoft which I can not open. Any ideas ? Thanks Take a look here, it may help: http://www.slipstick.com/config/backup.htm --=81 Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. All unsolicited mail sent to my personal account will be deleted without reading. =20 After furious head scratching, q1m7ot001@sneakema...

how to rename a file #2
What MFC class/function would I use to rename a file. Assume the file is not being accessed by any application. I have typically used the C run time library function 'rename' but his there a comparable MFC or SDK function? Thanks Ian Hi, You could use CFile::Rename. Regards Andy Mortimer [MS] Please do not send email directly to this alias. This alias is for newsgroup purposes only This posting is provided "AS IS" with no warranties, and confers no rights. OR if you wish to include a script sample in your post please add "Use of included script samples a...

Sharing .pst file
Hello, Is it possible to share the .pst file of Outlook. So it is possible for 2 people changing the agenda at the same time in the same .pst file? Thanks in advance No. Outlook.pst files require exclusive read/write access at all times so it cannot be shared. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the (insert latest virus name here) virus, all mail sent to my personal account will be deleted without reading. After searching google.groups.com and finding no answer, Waterman asked: | Hello, | | | Is it possib...

how do i rename a sheet if the rename tab is inactive?
I tried to rename a sheet in a workbook but discovered that the rename option is inactive when i right-clicked on the sheet. How do i make it active ? Hi, This would happen if the 'workbook' was protected. Tools|Protection|Unprotect workbook -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "Nelson" wrote: > I tried to rename a sheet in a workbook but discovered that the rename option > is inactive when i right-clicked on the ...

Outlook Express 6 XPSP2 locks up while drag & dropping files.
Hi, To get I to someone that may bea ble to do something about it. (ie: bug report), I am posting this. The normal bug report process does not come up. It is very repeatable, while trying to drag and drop filess to a different folder, the program will lock up on certain emails that have content that requires one to accepting or reject do to security settings. If you are not already viewing the email trying to drag and drop it can cause this to happen. (In my case, it is an eBay generated email that I have previously viewed and am trying to sort to folders so I can find it e...

open an .exe file for its resources
Hi, In one of Mike Blaszczak's books for VC++ 6.0, he said we can File/Open an executable file (.exe or .dll) and then edit the resources (e.g. a dialog) in the executable's immage. I tried but nothing happened. The only thing I saw was a blank work space with the executable's file name on the file view. Do you know how to make it happen? Thanks. Tony ps. No copy-right violation activity will be involved. I don't know if this worked in 6.0 (haven't used for some time), but I just tried opening an EXE in 2003 and it works fine. It displays the resources in a ...

Slow to Open File
I have a file with about 40,000 records. All 40,000 records have hyperlinks in Column A. This file takes about one minute to open, and is very slow to edit, sort and modify! When I remove Column A, the file opens quickly. Is there a better way to store or reference my hyperlinks so that my file will open/process more quickly? Replace each hyperlink with the Hyperlink function... =HYPERLINK(location, name to display) The function uses less memory. -- Jim Cone Portland, Oregon USA "iamnu" <iamnubw@gmail.com> wrote in message I have a file with about 40,000 records. All 40...

Renaming your password
I wanted to ask if someone could tell me if it is possible to rename your password? I would like to keep my existing e-mail accounts, and all of my folders and saved information. However, I was told that if someone knows my password and e-mail address, they can access my account from any other computer, anywhere. So, is there some way to handle this without losing the small group of links and e-mail boxes, etc. without bailing out? To change your email account password, contact the account provider, or check their website for assistance. -- Dave N. MS-MVP (Mail) ...

Lotus 1-2-3 file
Is there any way to open a Lotus .wk4 file in Excel 2000 without everything changing? ...

smtp addresses #2
Exchange 2000. I have 2 smtp addresses under recipient policy. smtp: username@domain.com (set as default) smtp: username@local.domain.com These were created automatically when we migrated from exchange 5.5 to 2000. local.domain.com is our internal domain. domain.com is our Internet address. I unchecked local.domain.com address, and "Apply this policy now", but it did not remove them from each users AD account. So I deleted the local.domain.com address, and "Apply this policy now", but it still did not remove them from each users AD account. We are getting NDR's b...

Opening Text Files and Re-Saving Them
Hi. I am trying to write some code which will allow a user to select a folder and then will open all of the text files in that folder and re-save them as excel files. I have sorted out the code to enable the user to select the folder they wish to use, but am looking some assistance on the looping to enable each of the text files to be opened and re-saved. Can anyone suggest how I might do this. Thanks. If the text files are all the same, you could record a macro that Opens, saves as an excel file, and closes the file. Then that recorded macro could be modified to open...

Calculate number of months between 2 dates #2
Hi Daniel, thanks and works fine, though I added a condition "if(endin date - starting date =20,0)". .... (smaller or equal to 20) John. Daniel CHEN Wrote: > Use the following formula: > > =(YEAR(A2)-YEAR(A1))*12+MONTH(A2)-MONTH(A1)-1+IF(DAY(A1)=15,1,0)+IF(DAY(A2)=15,1,0) > > assume A1 is starting date and A2 is ending date. > > ===== * ===== * ===== * ===== > Daniel CHEN > > Spreadsheet/VBA Specialist > UDQServices@Gmail.com > www.Geocities.com/UDQServices > Try UDQ Consulting Services - Your "Impossible" Task Could Be Someon &g...

Email Errors> no download of messages>error messages. #2
Email Errors> no download of messages>error messages. My email has been working just fine until today. I can't think of anything I've done to create a problem. I'm using WindowsXP-pro-sp2; Outlook 2003, and Norton AntiVirus 2005. The same problem just started in Outlook Express as well. Was on the phone with Charter for over two hours removing email accounts and then adding them from scratch. I've been trying for hours and hours fix this to no avail--the error message keeps coming up and I'm expecting some very important email. The error messages will say someth...

convert PDF file to excel 2007 file
Anyone know how to convert a PDF file to an Excel 2007 file? Need help. Thanks You use software like this. http://www.pdftransformer.com/ Bob Heideloff wrote: > Anyone know how to convert a PDF file to an Excel 2007 file? Need help. > Thanks > > ...