Replace All across project files

Sample Image of ReplaceAll add-in

Environment: VC6 SP3, NT4 SP5

This is MS Visual Studio add-in to find and replace texts across project files (if any loaded). (Project files == files enumerated in project's .dsp file. They appear in workspace's FileView.)

It is based on MS sample project ReplAll. It enhances the sample functionality - possibility to find and replace across open files. It uses standard "Find & Replace" dialog (from VStudio).

Project file enumerating functionality is fully copied from Joshua C.Jansen's Workspace Utilities (there are only some minor changes - char -> TCHAR, Exclude and Special Added files aren't used).

The result of the work of this add-in is the set of a changed files - the files opened before add-in run (and not saved) are closed.

Downloads

Download source - 28 Kb
Download addin DLL - 26 Kb


Comments

  • Crashes in Release / Wrong Message Mapping

    Posted by Legacy on 08/16/2003 12:00am

    Originally posted by: Beutler

    There is an awesome error which leads into a crash in release mode, when picking one of the predefined regExp-terms.

    MFC Message handlers must be declared regarding the message map macro, e.g. for

    ON_COMMAND(ID_XY, xy)

    xy must be defined as void xy(void), not void xy(WPARAM, LPARAM).
    Painfully, in debug mode everything is going richt.

    However, nice macro.

    Reply
  • Works for all open, not for project

    Posted by Legacy on 06/25/2003 12:00am

    Originally posted by: Bill Turner

    Even with .psw and souce files in same dir, and with sourece files open; no change when 'project files' checked.

    Reply
  • Crashes

    Posted by Legacy on 07/28/2002 12:00am

    Originally posted by: dEUs

    Hi,
    Your Addin killed my VS ... I searched for PaintFigur(CDC *pDC, int nFieldSize) and wanted to replace it with PaintFigur(CDC *pDC, CBitmap *bmpFiguren, int nFieldSize)

    Greets,
    dEUs

    Reply
  • Works perfect

    Posted by Legacy on 06/19/2002 12:00am

    Originally posted by: Marco Eugster

    This tool works perfect. Also with multiple projects in the workspace.

    Reply
  • A Class Hierarchy Visualization Tool

    Posted by Legacy on 05/28/2001 12:00am

    Originally posted by: Steven Zee

    DocBuilder satisfies a basic need of an object oriented software developer - it lets you see the class hierarchy of your C++ projects. DocBuilder quickly generates a complete printable hierarchy of your classes, including classes from third party libraries,that's not all,DocBuilder can also generates html files from the class information,please visit http://www.ucancode.net for more information about docbuilder

    Reply
  • Doesn't work with more than one project in the workspace

    Posted by Legacy on 12/13/2000 12:00am

    Originally posted by: Alexander Keck

    Looks nice, but doesn't work here.

    I have a workspace with about 20 projects inside.
    The thing I want to replace occures 313 times. (checked with find in files).
    This tool returns without any delay and does nothing.
    Since the folder where the .dsw file is located is empty (except for the subdirs for the projects and the .dsw file) it can't find anything...

    Reply
  • Don't work in NT4.0 when not in Admin mode : Bug Fix

    Posted by Legacy on 08/24/2000 12:00am

    Originally posted by: Feneck

    The problem is : When you are in User Mode, you cannot open CLSID key with all access : open it only in Read/Write
    
    

    Modify the function STDAPI DllRegisterServer(void) like this :


    // by exporting DllRegisterServer, you can use regsvr32.exe
    STDAPI DllRegisterServer(void)
    {
    AFX_MANAGE_STATE(AfxGetStaticModuleState());
    HRESULT hRes = S_OK;

    // Registers object, typelib and all interfaces in typelib
    hRes = _Module.RegisterServer(TRUE);
    if (FAILED(hRes))
    return hRes;

    // Register description of this add-in object in its own
    // "/Description" subkey.

    _ATL_OBJMAP_ENTRY* pEntry = _Module.m_pObjMap;
    CRegKey key;
    LONG lRes = key.Open(HKEY_CLASSES_ROOT, _T("CLSID"),KEY_READ | KEY_WRITE);
    if (lRes == ERROR_SUCCESS)
    {
    USES_CONVERSION;
    LPOLESTR lpOleStr;
    StringFromCLSID(*pEntry->pclsid, &lpOleStr);
    LPTSTR lpsz = OLE2T(lpOleStr);

    lRes = key.Open(key, lpsz,KEY_READ | KEY_WRITE);
    if (lRes == ERROR_SUCCESS)
    {
    CString strDescription;
    strDescription.LoadString(IDS_REPLALL_DESCRIPTION);
    key.SetKeyValue(_T("Description"), strDescription);
    }
    else
    {
    CString csText;
    csText.Format(_T("Cannot open Key : HKEY_CLASSES_ROOT\\CLSID\\%s"),lpsz);
    MessageBox(NULL,csText,_T("Error registering AddIns"),MB_ICONSTOP);
    }
    CoTaskMemFree(lpOleStr);
    }
    else
    MessageBox(NULL,_T("Cannot open Key : HKEY_CLASSES_ROOT\\CLSID"),_T("Error registering AddIns"),MB_ICONSTOP);
    if (lRes != ERROR_SUCCESS)
    hRes = HRESULT_FROM_WIN32(lRes);

    return hRes;
    }

    Reply
  • Nice but...

    Posted by Legacy on 01/09/2000 12:00am

    Originally posted by: Kot Begemot

    This is a neat tool, however I'd love it much more if it has an option to skip a particular change, just like the default "Replace" does.

    Thanks for sharing.

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Java developers know that testing code changes can be a huge pain, and waiting for an application to redeploy after a code fix can take an eternity. Wouldn't it be great if you could see your code changes immediately, fine-tune, debug, explore and deploy code without waiting for ages? In this white paper, find out how that's possible with a Java plugin that drastically changes the way you develop, test and run Java applications. Discover the advantages of this plugin, and the changes you can expect to see …

  • Packaged application development teams frequently operate with limited testing environments due to time and labor constraints. By virtualizing the entire application stack, packaged application development teams can deliver business results faster, at higher quality, and with lower risk.

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds