Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. ATL / WTL / STL
  4. where is WINVER set (resolved)

where is WINVER set (resolved)

Scheduled Pinned Locked Moved ATL / WTL / STL
c++csharpvisual-studiocomquestion
4 Posts 3 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bkelly13
    wrote on last edited by
    #1

    Windows XP, soo not be Win 7, Visual Studio 2008, C++ Every build proclaims that WINVER is not defined, setting to 0x600 Windows Vista. This is on Windows XP so I don't understand why it is setting to Vista. Where should it be set? stdafx has the lines: #ifndef WINVER #define WINVER 0x0400 // this line grayed out #endif That indicates it is already set, but the output window says not. I put this definition in the first include file AR2_Message_AppDlg.cpp #define WINVER 0X0601 but it appears to be ignored. An MSDN web page said to put it in "a header file." It does not say which one. Where should the definition be placed?

    Thank you for your time If you work with telemetry, please check this bulletin board: www.irigbb.com

    L T 2 Replies Last reply
    0
    • B bkelly13

      Windows XP, soo not be Win 7, Visual Studio 2008, C++ Every build proclaims that WINVER is not defined, setting to 0x600 Windows Vista. This is on Windows XP so I don't understand why it is setting to Vista. Where should it be set? stdafx has the lines: #ifndef WINVER #define WINVER 0x0400 // this line grayed out #endif That indicates it is already set, but the output window says not. I put this definition in the first include file AR2_Message_AppDlg.cpp #define WINVER 0X0601 but it appears to be ignored. An MSDN web page said to put it in "a header file." It does not say which one. Where should the definition be placed?

      Thank you for your time If you work with telemetry, please check this bulletin board: www.irigbb.com

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      The Windows version is set from the SDK header files, so it does not necessarily match the actual level of Windows that you are developing on. You can set it to your own target in your main header file, before your include of windows.h; if using precompiled headers then that would be your version of stdafx.h.

      1 Reply Last reply
      0
      • B bkelly13

        Windows XP, soo not be Win 7, Visual Studio 2008, C++ Every build proclaims that WINVER is not defined, setting to 0x600 Windows Vista. This is on Windows XP so I don't understand why it is setting to Vista. Where should it be set? stdafx has the lines: #ifndef WINVER #define WINVER 0x0400 // this line grayed out #endif That indicates it is already set, but the output window says not. I put this definition in the first include file AR2_Message_AppDlg.cpp #define WINVER 0X0601 but it appears to be ignored. An MSDN web page said to put it in "a header file." It does not say which one. Where should the definition be placed?

        Thank you for your time If you work with telemetry, please check this bulletin board: www.irigbb.com

        T Offline
        T Offline
        Theo Buys
        wrote on last edited by
        #3

        With visual studio "find in files", you can find all #define WINVER when look in "visual c++ include directories" I get: winres.h, sdkddkver.h, vdssys.idl, WinDef.h, WinGDI.h, WinReg.h, WinResrc.h, winsdkver.h and WinUser.h But you have to start follow the includes in your stdafx.h to find the ones your application is including. I see: #include "targetver.h" which includes #include which is one on my list and contains #ifndef WINVER #ifdef _WIN32_WINNT // set WINVER based on _WIN32_WINNT #define WINVER _WIN32_WINNT #else #define WINVER 0x0601 #endif #endif So if you put in stdafx.h #ifndef WINVER #define WINVER 0x0400 #endif before #include "targetver.h" then it is not grey out.

        B 1 Reply Last reply
        0
        • T Theo Buys

          With visual studio "find in files", you can find all #define WINVER when look in "visual c++ include directories" I get: winres.h, sdkddkver.h, vdssys.idl, WinDef.h, WinGDI.h, WinReg.h, WinResrc.h, winsdkver.h and WinUser.h But you have to start follow the includes in your stdafx.h to find the ones your application is including. I see: #include "targetver.h" which includes #include which is one on my list and contains #ifndef WINVER #ifdef _WIN32_WINNT // set WINVER based on _WIN32_WINNT #define WINVER _WIN32_WINNT #else #define WINVER 0x0601 #endif #endif So if you put in stdafx.h #ifndef WINVER #define WINVER 0x0400 #endif before #include "targetver.h" then it is not grey out.

          B Offline
          B Offline
          bkelly13
          wrote on last edited by
          #4

          Ok, I am using that now, in stdafx.h Thank you for your time.

          Thank you for your time If you work with telemetry, please check this bulletin board: www.irigbb.com

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups