Use the new feature "Refactor - Create File..." to create a new .cpp file based on an existing .h file. However the .cpp file cannot be renamed via Visual Studio renaming (such as F2) or "Refactor - Rename Files...".
I wasn't able to reproduce this using VS2012 update 1 and VA1925.
Which Visual Studio version are you using? What do you mean cannot be renamed? What happens when you select the file and press F2? Are you able to rename other files? What happens if you try to use the "Rename Files.." refactoring? Is the menu item grayed out in the editor context menu?
I am using VS 2010, not sure about its behavior under VS 2012. The steps are:
(1) Create a new solution. (2) Add a head file, such as "aa.h", by visual studio. (3) Open the file. (4) Right click any point in the edit window of the file; choose Refactor (VA X) - Create File... in the context menu. (5) A dialog to create a new file named "aa.cpp" pops up. Click "Ok" to add it. (6) Right click any point in the edit window of the file "aa.cpp" (or "aa.h"); choose Refactor (VA X) - Rename Files... in the context menu. (7) Change the file name to "bb" in the pop-up dialog. (8) Then the attached message box appears to show some warning that I think it should not be.
Thanks.
Edited by - jayden_shui on Feb 01 2013 08:41:34 AM