Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Strip'em Add-in for Visual Studio 6.0

0.00/5 (No votes)
7 Mar 2001 1  
This Add-in converts the text format (DOS or UNIX) of a file when it is saved in Visual Studio.
  • Download source files - 21 Kb
  • Download the add-in - 19 Kb
  • Strip

    Introduction

    This Add-in converts the text format of a file when it is saved in Visual Studio. This can be very useful when working in a mixed Windows-Unix environment. In Unix, end of lines in text files are identified by line feed characters. In Windows - they are identified by a combination of carriage return and line feed.

    This add-in makes sure that files will be saved the way you want. When invoked, it opens a dialog box in which you can select the text mode you need.


    Setup

    1. Copy Stripem.dll to any place you want. A good place would be under the Microsoft Visual Studio folder at Common\MSDev98\AddIns.
    2. Open Visual Studio and select: Tools | Customize...
    3. Go to the Add-ins and Macro files tab and click on the Browse button.
    4. Go to the folder to which you copied Stripem.dll and select it. Make sure the Files of type listbox is on Add-ins (.dll).
    5. When closing the dialog, a toolbar will appear with the Strip'em button. Using the customize dialog you can move this button to any other toolbar (if you want to).
    6. Pressing the button will open a dialog box in which you can select the text mode you want to use.


    Possible problems

    After saving a file, the add-in kicks in and start replacing carriage returns and line feeds. If the file is opened in Visual Studio, it will open a dialog box saying that the file has changed, and will ask if you want to reload it. This is quite annoying so you can set up Visual Studio to automatically reload changed files. To do this, select: Tools | Options | Editor, and check "Automatic reload of externally modified files".

    This add-in was built with Visual C++ 6.0 with service pack 3. I haven't tested it with other versions, so you can take your chance. I heard from a friend that it didn't work with DevStudio/Visual C++ 5, so he downloaded the source, compiled it and then it worked.

    If the add-in doesn't "remember" its previous settings between Visual Studio sessions, check the registry for the following key:

    HKEY_CURRENT_USER\Software\Microsoft\DevStudio\6.0
    

    This is where Visual Studio saves its data and where the add-in creates its sub-keys. If it doesn't exist you may have a Visual Studio setup problems. If the key exists, it should have the following sub-key:

    AddIns\Stripem.DSAddIn.1
    

    This is where the add-in saves its data. If the key doesn't exist, create it manually and see if it works.


    Version History

    Version 1.01.0
    • Added a new option: save in Windows mode. Until now you could either remove CR characters or do nothing. Now you can convert single LF characters to CR+LF pairs - convert from Unix to Windows format.

    Version 1.00.2

    • First release outside my small beta tester comunity. (source files updated)


    Version 1.02.0

    • Thanks to Jeff Cohen, the code works much faster, especially on large files.

    Contacting me

    You can download the latest version of the add-in from my website, together with other tools and utilities.
    For bug reports, requests and annoyances, write to me at: etay@writeme.com.


    License

    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here