Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++
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 14:06pm
T21024.3K
Edited 11-Apr-11 14:07pm
v2

1 solution

Rate this: bad
good
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.
  Permalink  
Comments
T2102 at 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 at 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 at 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
0 OriginalGriff 304
1 Maciej Los 285
2 Sergey Alexandrovich Kryukov 230
3 Shweta N Mishra 186
4 Aajmot Sk 153
0 OriginalGriff 7,660
1 Sergey Alexandrovich Kryukov 7,072
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,760


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 11 Apr 2011
Copyright © CodeProject, 1999-2014
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