Click here to Skip to main content
15,881,559 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to edit a vcxproj file and possibly some source code to take a different value when the OS is Windows XP versus Windows 7. For instance, I have code that I run under Excel 2003 in Windows XP and under Excel 2010 in Windows XP. I would like to change the Debugging entry to the associated Excel executable accordingly. Where would I find the relevant documentation to do this?
Posted
Updated 11-Apr-11 13:07pm
v2

1 solution

Your three choices are:

1. Conditional compile using statements like #ifdef EXCEL2003 etc.

2. Conditional run-time selection; this would use some run-time variable like this:
if bExcel2003)
{
    // do Excel 2003 stuff
}


3. You can take (2) to the extreme and have different DLLs depending on the Excel version.
 
Share this answer
 
Comments
T2102 11-Apr-11 22:04pm    
Yes, I understand that I can use conditional compilation. I am hoping to find a preprocessor macro that differentiates windows 7 from windows xp sp3 and hoping it's usable in vxproj too.
Hans Dietrich 11-Apr-11 22:19pm    
A preprocessor macro is just that - it gets interpreted before the compile. So at run-time, a preprocessor macro has already come and gone, and can't possibly do what you want. You need something that runs at run-time, that will choose the correct code to run.
T2102 11-Apr-11 22:29pm    
Yes, I want something interpreted before the compile. My desktop has Windows 7 and my laptop has Windows XP. I want to be able to work and debug on my code on either computer without maintaining two copies of vcxprojs and props files.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900