CRelativePaths v1.02 Convert relative
to absolute paths and vice versa
Welcome toCRelativePaths, a C++ class to convert to and from relative
paths, This is similar to how Visual Studio stores filenames in a project / workspace.
This means that you can copy a project to a different drive and recompile without
The enclosed zip file contains the source
code and a simple VC2005 test application which exercises the class.
- You are allowed to include the source code in any product (commercial, shareware,
freeware or otherwise) when your product is released in binary form.
- You are allowed to modify the source code in any way you want except you
cannot modify the copyright details at the top of each module.
- If you want to distribute source code with your application, then you are
only allowed to distribute versions released by the author. This is to maintain
a single distribution point for the source code.
1 May 2017
- Updated the demo app to compile cleanly using /permissive-.
27 December 2015
- Verified the code compiles cleanly on VC 2015.
V1.02 (28 June 2015)
- Updated copyright details.
- Updated the code to clean compile on VC 2008 & later
- Updated the code to require VC 2005 or later
- Updated the code to be a header only implementation
- Reworked the RelativeToAbsolute method to return the string return value
as an output parameter instead of a return value.
- Updated the code to include SAL annotations.
- Reworked the code to optionally compile without MFC. By default the code
now use STL classes and idioms but if you define RELATIVEPATHS_MFC_EXTENSIONS
the code will revert back to the MFC behaviour.
- Removed the static critical section member variable of the CRelativePaths
class. Please note that while the RelativeToAbsolute method is executing it
is possible that code in some other thread of your app could also be modifying
the current working directory. To avoid such race conditions you should serialize
that code with the execution of RelativeToAbsolute with something like a critical
V1.01 (28 December 2006)
- Updated copyright details
- Addition of a CRELATIVEPATHS_EXT_CLASS preprocessor macro to allow the classes
to be more easily added to an extension dll
- Updated the code to clean compile on VC 2005
- Updated the documentation to use the same style as the web site
V1.0 (7 April 2003)