Hi there,
I am writing a code to print the results for any given project into the corresponding solution directory. Here is my idea
//*** CODE***//
// In C/C++ properties, Preprocessor, "Preprocessor Definitions":
MY_SOLUTIONDIR=$(SolutionDir)
// In the cpp file:
#define OP OP2(MY_SOLUTIONDIR)
#define OP2(x) OP3(x)
#define OP3(a) #a
string print_folder = OP;
print(print_folder, my_results);
//*** RESULTS***//
MY_SOLUTIONDIR = C:\Projects\My_project
print_folder = "C: ProjectsMy_project" (here I lose the backslashes)
I need to convert MY_SOLUTIONDIR into a string for my print function. With my 3-level macro OP I manage to add quotation marks to get a string but I have a problem with the backslash as C++ requires double backslashes.
Any idea on how to convert the MY_SOLUTIONDIR into a 'good' string? Any other idea on how to use the $(SolutionDir) of the preprocessor for a function requiring a string as an input?
Many thanks,
Matthieu