Conditional include - Programmer

This is a discussion on Conditional include - Programmer ; Hello, One of my stdafx.h includes/imports a xyz.tlb file. Path for this TLB will be different on XP and Windows 2000. Is there any environment variable which I could use to determine whether I am on XP or not. This ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Conditional include

  1. Conditional include

    Hello,
    One of my stdafx.h includes/imports a xyz.tlb file. Path for this TLB
    will be different on XP and Windows 2000. Is there any environment
    variable which I could use to determine whether I am on XP or not.
    This will give me a way to include correct file.
    Thanks and regards


  2. Re: Conditional include

    On Sep 24, 1:48 am, Avi wrote:
    > Hello,
    > One of my stdafx.h includes/imports a xyz.tlb file. Path for this TLB
    > will be different on XP and Windows 2000. Is there any environment
    > variable which I could use to determine whether I am on XP or not.
    > This will give me a way to include correct file.
    > Thanks and regards



    Hi,

    You can use the following API/WMI class to get information about
    the Windows operating system:

    GetVersionEx() OSVERSIONINFOEX

    Win32_OperatingSystem

    http://msdn2.microsoft.com/en-us/library/ms724451.aspx

    http://msdn2.microsoft.com/en-us/library/aa394239.aspx

    Kellie.



  3. Re: Conditional include

    "Avi" wrote in message
    news:1190623680.340512.210600@r29g2000hsg.googlegr oups.com...
    > Hello,
    > One of my stdafx.h includes/imports a xyz.tlb file. Path for this TLB
    > will be different on XP and Windows 2000. Is there any environment
    > variable which I could use to determine whether I am on XP or not.
    > This will give me a way to include correct file.
    > Thanks and regards


    Never mind Kellie -- every once in a while he's in auto reply mode.

    I presume you are aware this check, as you describe it, can only be done on
    compile-time, not run-time.
    Perhaps you can use the __WINVER and/or __WINNT defines. Check if these
    values differ between XP & W2000.

    [Jongware]



  4. Re: Conditional include

    On Mon, 24 Sep 2007 17:55:16 +0200, "[Jongware]"
    wrote:

    >"Avi" wrote in message
    >news:1190623680.340512.210600@r29g2000hsg.googlegr oups.com...
    >> Hello,
    >> One of my stdafx.h includes/imports a xyz.tlb file. Path for this TLB
    >> will be different on XP and Windows 2000. Is there any environment
    >> variable which I could use to determine whether I am on XP or not.
    >> This will give me a way to include correct file.
    >> Thanks and regards

    >
    >Never mind Kellie -- every once in a while he's in auto reply mode.
    >
    >I presume you are aware this check, as you describe it, can only be done on
    >compile-time, not run-time.
    >Perhaps you can use the __WINVER and/or __WINNT defines. Check if these
    >values differ between XP & W2000.
    >
    >[Jongware]
    >


    From notes in my source code:
    A contribution by Giuliano to a thread called, "Detecting Windows NT
    OS" in comp.os.ms-windows.programmer.win32 around 18 Nov 02 says
    _winver is 0x500 for Win 2K and 0x501 for XP

    I don't seem to use that info, so I can't confirm.
    -----------------------------------------
    To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

    Robert E. Zaret, eMVP
    PenFact, Inc.
    20 Park Plaza, Suite 400
    Boston, MA 02116
    www.penfact.com

+ Reply to Thread