Click here to Skip to main content
13,357,514 members (35,619 online)
Click here to Skip to main content
Add your own
alternative version


19 bookmarked
Posted 4 Apr 2000

Strip'em Add-in for Visual Studio 6.0

, 7 Mar 2001
Rate this:
Please Sign up or sign in to vote.
This Add-in converts the text format (DOS or UNIX) of a file when it is saved in Visual Studio.

Updated software page and download links here


  • 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:


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:


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, visit my website.



This article, along with any associated source code and files, is licensed under The Creative Commons Attribution-ShareAlike 2.5 License


About the Author

Software Developer (Senior)
Israel Israel
It's all in my website

You may also be interested in...

Comments and Discussions

GeneralUpdated version for Visual Studio 2008 Pin
Itay Szekely17-Aug-09 6:29
memberItay Szekely17-Aug-09 6:29 
GeneralVisual Studio 6.0 SP5 Pin
jfgao6-Jul-07 6:41
memberjfgao6-Jul-07 6:41 
QuestionFurther??? Pin
Cheng Jin Kang13-May-04 7:17
memberCheng Jin Kang13-May-04 7:17 
GeneralPerfect Pin
Jack Handy17-Apr-03 20:33
memberJack Handy17-Apr-03 20:33 
GeneralExcellent stuff (+ minor enhancement) Pin
James Wilkinson5-Oct-00 1:55
sussJames Wilkinson5-Oct-00 1:55 
We find this AddIn to be invaluable in a cross-platform

I made a couple of modifications, though:

1) Instead of writing a temporary file into the same
location as the original file, I create the temp. file
in %TEMP%. If file permissions are such that a user
can modify a file, but can't add files to a directory,
then this fix will get around that problem.

Here is the code (excuse the poor quality..)

CString filename(filenamew);
CString tempfile(filenamew);

CString tmpdir;
CString tmpfile;

UINT ui = GetTempPath(MAX_PATH, tmpdir.GetBuffer(MAX_PATH));
UINT ui2 = 0;

if (ui)
ui2 = GetTempFileName((LPCTSTR)tmpdir, "Str", 0, tmpfile.GetBuffer(MAX_PATH));

if (ui2)
tempfile = tmpfile;
// AfxMessageBox("Using my tmpfile = " + tempfile);
tempfile += ".tmp"; // Stick with original idea Wink | ;-)

2) Also, we were seeing a lot of 'Failed to create
temporary file' errors because MoveFile failed as the
temp file already existed. This is easy to fix:

// Copy the file to a temporary file
if (!::MoveFileEx(filename, tempfile, MOVEFILE_REPLACE_EXISTING))
CString strErr;
strErr.Format("%i", GetLastError());
AfxMessageBox("Failed to create temporary file, error = " + strErr);
return S_OK;

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

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.180111.1 | Last Updated 8 Mar 2001
Article Copyright 2000 by grebulon
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid