Click here to Skip to main content
13,045,285 members (64,013 online)
Rate this:
Please Sign up or sign in to vote.
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 11-Apr-11 13:06pm
Updated 11-Apr-11 13:07pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 11 Apr 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100