Movatterモバイル変換


[0]ホーム

URL:


Wayback Machine
5 captures
18 Jun 2009 - 25 Oct 2012
NovDECOct
Previous capture16Next capture
200920112012
success
fail
COLLECTED BY
Organization:Alexa Crawls
Starting in 1996,Alexa Internet has been donating their crawl data to the Internet Archive. Flowing in every day, these data are added to theWayback Machine after an embargo period.
Collection:Alexa Crawls
Starting in 1996,Alexa Internet has been donating their crawl data to the Internet Archive. Flowing in every day, these data are added to theWayback Machine after an embargo period.
TIMESTAMPS
loading
The Wayback Machine - https://web.archive.org/web/20111216182023/http://www.codeproject.com:80/KB/cpp/ProjRename.aspx
Click here to Skip to main content
8,339,867 members and growing!
EmailPassword Lost password?
Home
Search within:




Licence CPOL
First Posted 9 Jun 2009
Views 14,228
Downloads 329
Bookmarked 36 times

Project Rename - Rename an Existing Visual Studio Project

ByFlying Light | 9 Jun 2009
MFC Application to rename an Existing Visual Studio Project
 
See Also
Print Article
add
Add to your CodeProject bookmarks
Discuss
Discuss this article
11
  4.37 (9 votes)

1

2
2 votes, 22.2%
3

4
7 votes, 77.8%
5
4.37/5 - 9 votes
μ 4.37, σa 1.54 [?]
Sponsored Links
ProjectRename

ProjRename-11.jpg

Introduction

This is an MFC application that renames Visual C++ Projects.
This application will replace all occurences of "Current Project Name" to "New Project Name" in all files and rename all file names that have "Current Project Name" in it.

This application supports:

  1. VC6 ~ VC9 Projects
  2. Changing the Project GUID
  3. Allows cancel during renaming
  4. UTF-8 files that may be created when the project name was non-english language
  5. Shows elapsed time and failed file list

    ProjRename-12.jpg

This application was developed for Windows XP and uses Windows XP visual style.
The borders of controls likeCEdit may not be displayed clearly on Windows Vista.

Usage

  1. Browse the Visual C++ project to rename (*.dsp *.sln)
  2. Enter new project name
  3. Select "Project GUID change" if you want to change the project GUID
    (You can change GUID if you don't like the generated GUID)
  4. Click "Rename" to begin processing

Using the Code

This program is a dialog based application.
It has two views, one is "SelectView" the other is "ProgressView".

BEGIN_MESSAGE_MAP(CProjectRenameDlg, CDialog)   ON_WM_SYSCOMMAND()   ON_WM_PAINT()   ON_WM_QUERYDRAGICON()   ON_WM_DESTROY()   ON_MESSAGE(WMU_SELECT_VIEW_CLOSE, OnSelectViewClose)   ON_MESSAGE(WMU_PROGRESS_VIEW_CLOSE, OnProgressViewClose)   ON_MESSAGE(WMU_RENAME_FINISHED, OnRenameDone)   ON_MESSAGE(WMU_RENAME_CANCELED, OnCancelRename)END_MESSAGE_MAP()

When the user clicked "Rename" to begin renaming,WM_SELECT_VIEW_CLOSEmessage is sent from "SelectView" and the thread to process is created.

LRESULT CProjectRenameDlg::OnSelectViewClose(WPARAM wParam, LPARAM lParam){   m_pRenameThread = (CRenameThread*)AfxBeginThread(RUNTIME_CLASS(CRenameThread), THREAD_PRIORITY_NORMAL,0, CREATE_SUSPENDED);   m_pRenameThread->m_bCancel = FALSE;   m_pRenameThread->m_pOwner =this;   m_pRenameThread->m_renameOptions = ((CSelectView*)m_pSelectView)->GetRenameOptions();   m_pRenameThread->ResumeThread();}

When renaming has been finished, the thread sendsWM_RENANE_FINISHEDmessage to notify that renaming has been completed. 

BOOL CRenameThread::InitInstance(){    ASSERT(!m_renameOptions.strCurrentPath.IsEmpty());// Make list of files to rename    m_astrFileList.RemoveAll();    PrepareRename(m_renameOptions.strCurrentPath);    m_renameStatus.nTotalFiles = m_astrFileList.GetSize();    m_renameStatus.nCheckedFiles =0;    m_renameStatus.nRenamedFiles =0;    m_renameStatus.astrErrorList.RemoveAll();    ProcessRename(m_renameOptions.strCurrentPath);return FALSE;}int CRenameThread::ExitInstance(){    m_pOwner->PostMessage(WMU_RENAME_FINISHED);return CWinThread::ExitInstance();}

History

  • 8 Jun 2009: Version 0.10 Released
  • 9 Jun 2009: Version 0.11 Fixed bug with writing to UFT-8 files

License

This article, along with any associated source code and files, is licensed underThe Code Project Open License (CPOL)

About the Author

Flying Light



Korea (Republic Of) Korea (Republic Of)

Member


loading...
Sign Up to vote  PoorExcellent
Add a reason or comment to your vote:x
Votes of 3 or less require a comment

Comments and Discussions

 
 RefreshFirstPrevNext
Generalerror when project including a XML filemembermaplewang22:16 24 Oct '10  
GeneralRe: error when project including a XML filememberFlying Light14:38 27 Oct '10  
GeneralRe: error when project including a XML filemembermaplewang22:23 22 Nov '10  
GeneralGot error when running ProjRen.exememberehaerim11:11 15 Jun '09  
GeneralRe: Got error when running ProjRen.exemembermerano14:54 15 Jun '09  
GeneralRe: Got error when running ProjRen.exememberehaerim15:19 15 Jun '09  
AnswerPlease download static executablememberFlying Light19:48 15 Jun '09  
AnswerRe: Got error when running ProjRen.exemembermerano4:47 16 Jun '09  
General#include "res\ProjectRenameDlg.rc2" // non-Microsoft Visual C++ edited resources missingmembertransoft3:12 10 Jun '09  
AnswerPlease download missing filesmemberFlying Light4:00 10 Jun '09  
Last Visit: 19:00 31 Dec '99     Last Update: 8:20 16 Dec '1112Next »

General General   News News   Suggestion Suggestion   Question Question   Bug Bug   Answer Answer   Joke Joke   Rant Rant   Admin Admin   

Permalink |Advertise |Privacy |Mobile
Web04 |2.5.111208.1 |Last Updated 9 Jun 2009
Article Copyright 2009 by Flying Light
Everything elseCopyright ©CodeProject, 1999-2011
Terms of Use
Layout:fixed|fluid

See Also...
The Daily Insider

[8]ページ先頭

©2009-2025 Movatter.jp